:root {
  --bg: #0b0d12;
  --surface: #12161f;
  --surface-2: #181d28;
  --border: #232a38;
  --text: #eef0f5;
  --muted: #8d95a8;
  --gold: #f5c451;
  --gold-2: #dd9f0b;
  --font: "Segoe UI", "Khmer UI", "Noto Sans Khmer", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(245, 196, 81, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 30%, rgba(56, 189, 248, .07), transparent 60%),
    radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}
a { color: inherit; }
code {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 13px;
}

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(11, 13, 18, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 17px; }
.brand b { color: var(--gold); }
.logo {
  width: 38px; height: 38px; border-radius: 10px;
  display: block; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(245, 196, 81, .35);
}
.hero-logo {
  display: block; margin: 0 auto 24px;
  width: min(260px, 60vw); height: auto;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(221, 159, 11, .28), 0 0 0 1px rgba(245, 196, 81, .25);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: var(--gold); }

/* hero */
.hero {
  position: relative;
  padding: 64px 32px 80px;
  text-align: center;
  background:
    radial-gradient(ellipse 480px 75% at 50% 52%, rgba(11, 13, 18, .72) 0%, rgba(11, 13, 18, .45) 60%, transparent 100%),
    linear-gradient(180deg, rgba(11, 13, 18, .15) 0%, rgba(11, 13, 18, .30) 75%, var(--bg) 100%),
    url("banner.jpg") center 40% / cover no-repeat,
    var(--bg);
}
.hero h1, .hero .lead { text-shadow: 0 2px 12px rgba(0, 0, 0, .9); }
.hero .lead { color: #e4e7ee; }
.hero .tag { color: #e4e7ee; background: rgba(18, 22, 31, .85); }
.hero-text { max-width: 760px; margin: 0 auto; }
.tag {
  display: inline-block; margin: 0 0 18px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.hero h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 54px); line-height: 1.2; }
.hero h1 span { color: var(--gold); }
.lead { margin: 0 auto 32px; max-width: 580px; color: var(--muted); font-size: 17px; }

/* buttons */
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 160px; padding: 12px 22px; border-radius: 12px;
  font: 600 15px var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: filter .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1d1300; box-shadow: 0 8px 24px rgba(221, 159, 11, .25); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: #33405a; }
.btn.disabled, .btn:disabled { background: #1a1f2a; color: var(--faint, #5c6476); border-color: var(--border); cursor: not-allowed; }

/* discord */
.btn.discord { background: #5865f2; color: #fff; box-shadow: 0 8px 24px rgba(88, 101, 242, .3); }
.btn.discord:hover { filter: brightness(1.1); }
.discord-box {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .22), rgba(88, 101, 242, .06)), var(--surface);
  border: 1px solid rgba(88, 101, 242, .45);
}
.discord-box h3 { margin: 0 0 4px; font-size: 20px; }
.discord-box p { margin: 0; color: #c3c8d4; font-size: 14.5px; }

/* sections */
.section { padding: 72px 32px; max-width: 1100px; margin: 0 auto; }
.section.alt { max-width: none; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section h2 { margin: 0 0 6px; font-size: 30px; position: relative; padding-left: 16px; }
.section h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 4px; background: linear-gradient(180deg, var(--gold), var(--gold-2)); }
.section:not(.alt) { position: relative; }
.section:not(.alt)::after { content: ""; position: absolute; left: 32px; right: 32px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.banner { position: relative; height: 340px; overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.banner::before, .banner::after { content: ""; position: absolute; left: 0; right: 0; height: 90px; z-index: 1; }
.banner::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.banner::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }
.banner-caption { position: absolute; z-index: 2; left: 0; right: 0; bottom: 28px; text-align: center; font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .8); letter-spacing: .3px; }
.banner-caption span { color: var(--gold); }
.muted { color: var(--muted); margin: 0 0 32px; }

/* download cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.card-icon { font-size: 30px; }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; flex: 1; }
.card .btn { width: 100%; }

/* account page (register / login) */
[hidden] { display: none !important; }
.account-page { min-height: 100vh; background: linear-gradient(rgba(11, 13, 18, .62), rgba(11, 13, 18, .82)), url("banner.jpg") center / cover no-repeat fixed, var(--bg); }
.auth-wrap { display: flex; justify-content: center; padding: 48px 16px 64px; }
.auth-box { width: 100%; max-width: 400px; align-self: flex-start; background: rgba(18, 22, 31, .95); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.auth-center { text-align: center; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 18px; background: var(--bg); border-radius: 12px; }
.tab { padding: 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 15px var(--font); cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--gold); }
.auth-box form { display: flex; flex-direction: column; }
.auth-box label { margin: 12px 0 5px; font-size: 14px; font-weight: 600; }
.auth-box input[type=text], .auth-box input[type=password] { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 16px var(--font); outline: none; }
.auth-box input[type=text]:focus, .auth-box input[type=password]:focus { border-color: var(--gold); }
.auth-box small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.auth-box label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }
.auth-box form .btn { margin-top: 20px; }
.auth-box .btn:disabled { cursor: wait; }
.form-msg { margin: 0 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: rgba(239, 83, 80, .14); border: 1px solid rgba(239, 83, 80, .5); color: #ffd5d4; }
#member h1 { margin: 0 0 16px; color: var(--gold); font-size: 28px; overflow-wrap: anywhere; }
.member-info { margin: 0 0 16px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.member-info dt { color: var(--muted); font-size: 12px; }
.member-info dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.member-note { color: var(--muted); font-size: 14px; }
#member .btn { width: 100%; margin-top: 8px; }
.auth-box:has(#member:not([hidden])) { max-width: 480px; }
.member-title { margin: 0 0 8px; font-size: 16px; text-align: left; }
.char-list { list-style: none; margin: 0 0 8px; padding: 0; text-align: left; }
.char-card { padding: 12px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.char-picture { display: block; width: 240px; max-width: 100%; height: auto; margin: 0 auto 8px; background: radial-gradient(ellipse at 50% 92%, rgba(245, 196, 81, .22), transparent 60%); }
.char-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.char-head strong { display: block; overflow-wrap: anywhere; }
.char-class { color: var(--muted); font-size: 12px; }
.char-level { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--gold); font-size: 13px; font-weight: 700; }
.char-money { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.char-money div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.char-money dt { color: var(--muted); font-size: 13px; }
.char-money dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
#password-form { text-align: left; margin-top: 4px; }
#password-message { margin: 10px 0 0; }
.form-msg.ok { background: rgba(76, 175, 80, .14); border-color: rgba(76, 175, 80, .5); color: #d4f5d6; }
.topbar nav a.nav-account { color: var(--gold); font-weight: 600; }

/* top up */
.price-table {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; margin-bottom: 20px;
}
.price-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px;
  padding: 16px 22px; border-top: 1px solid var(--border);
}
.price-row:first-child { border-top: 0; }
.price-row.head { color: var(--muted); font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .02); }
.price-row span:last-child { color: var(--gold); font-weight: 700; text-align: right; }
.note {
  background: rgba(245, 196, 81, .06); border: 1px solid rgba(245, 196, 81, .2);
  border-radius: 14px; padding: 16px 20px;
}
.note p { margin: 6px 0; color: #c3c8d4; font-size: 14px; }
.placeholder { color: var(--gold); font-style: italic; }

/* news */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
}
.news-item .date { color: var(--gold); font-size: 13px; font-weight: 600; }
.news-item h3 { margin: 6px 0 6px; font-size: 18px; }
.news-item p { margin: 0; color: #c3c8d4; font-size: 14.5px; white-space: pre-line; }

.footer { text-align: center; padding: 40px 32px 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.footer .links { display: flex; justify-content: center; gap: 22px; margin: 0 0 16px; flex-wrap: wrap; }
.footer .links a { color: var(--muted); text-decoration: none; }
.footer .links a:hover { color: var(--gold); }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar nav a { white-space: nowrap; }
  .topbar nav { gap: 14px; font-size: 13px; }
  .section { padding: 48px 18px; }
  .hero { padding: 64px 18px 56px; }
}

/* glow behind the hero logo */
.hero-art { position: relative; width: fit-content; margin: 0 auto 24px; }
.hero-art::before {
  content: ""; position: absolute; z-index: 0;
  left: 50%; top: 50%; width: 130%; height: 130%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(245, 196, 81, .32) 0%, rgba(245, 196, 81, .10) 42%, transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.hero-art::after {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 50%; width: 118%; height: 118%;
  transform: translate(-50%, -50%) rotate(-8deg);
  border-radius: 50%;
  border: 1px dashed rgba(245, 196, 81, .28);
}
.hero-art .hero-logo { position: relative; z-index: 1; margin: 0; }