:root {
  --bg: #0b1020;
  --bg2: #111833;
  --card: #151d3b;
  --line: #26305a;
  --text: #e8ecff;
  --muted: #98a2cc;
  --gold: #f5c451;
  --blue: #4f8cff;
  --green: #2fd08a;
  --red: #ff5d73;
  --trang: #4f8cff;
  --mailao: #b36bff;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
section[id], main[id] { scroll-margin-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, sans-serif; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
h2 { font-size: 26px; margin: 0 0 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: 10px; font-weight: 700; border: 1px solid transparent;
  cursor: pointer; font: inherit; font-weight: 700; transition: .15s; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-primary { background: linear-gradient(135deg, var(--gold), #ff9f43); color: #1a1300; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(1); }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11,16,32,.88);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #ff7a3d); color: #1a1300; font-size: 14px; }
.nav { display: flex; gap: 20px; margin-left: auto; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { background:
  radial-gradient(800px 380px at 85% 0%, rgba(79,140,255,.25), transparent 60%),
  radial-gradient(700px 360px at 0% 100%, rgba(245,196,81,.14), transparent 60%); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 64px 16px; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0 0 10px; }
h1 { font-size: 44px; line-height: 1.15; margin: 0 0 16px; }
.grad { background: linear-gradient(90deg, var(--gold), #ff9f43); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: 26px; color: var(--gold); }
.stat span { color: var(--muted); font-size: 14px; }

/* Types */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.type-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; overflow: hidden; }
.type-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.type-card h3 { margin: 0 0 6px; font-size: 21px; color: var(--c); }
.type-card p { margin: 0 0 14px; color: var(--muted); }
.type-card ul { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 6px; }
.type-card li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 8px; }
.type-card .from { font-size: 14px; color: var(--muted); }
.type-card .from b { color: var(--text); font-size: 18px; }

/* Shop */
.shop { padding-top: 56px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); padding: 10px 18px;
  border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.filters input[type=search], .filters select { background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit; min-width: 0; }
.filters input[type=search] { flex: 1 1 220px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-left: auto; cursor: pointer; }
.result-count { color: var(--muted); font-size: 14px; margin: 14px 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: .15s; cursor: pointer; }
.acc:hover { transform: translateY(-3px); border-color: var(--c); }
.acc.sold { opacity: .55; }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--thumb) center/cover;
  display: flex; align-items: flex-end; padding: 12px; }
.thumb .rank { font-weight: 800; font-size: 20px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.badge { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; background: var(--c); color: #fff; }
.badge-sale { left: auto; right: 10px; background: var(--red); }
.badge-sold { left: auto; right: 10px; background: #555; }
.acc-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.acc-name { margin: 0; font-size: 16px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.acc-id { color: var(--muted); font-size: 13px; font-weight: 600; }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.specs div { background: var(--bg2); border-radius: 8px; padding: 6px 2px; }
.specs b { display: block; font-size: 16px; }
.specs span { font-size: 11px; color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price { font-size: 21px; font-weight: 800; color: var(--gold); }
.old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 48px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Guide & FAQ */
.guide, .faq { padding-top: 64px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: #1a1300; font-weight: 800; margin-bottom: 10px; }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 14px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Footer */
.footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--bg2); padding: 28px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer p { margin: 4px 0 0; color: var(--muted); }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--gold); font-weight: 600; }
.disclaimer { flex-basis: 100%; font-size: 12px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3,6,15,.75); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; }
.modal-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; cursor: pointer; }
.m-thumb { aspect-ratio: 21/9; }
.m-content { padding: 20px 22px 24px; }
.m-content h3 { margin: 0 0 4px; font-size: 22px; }
.m-content .specs { grid-template-columns: repeat(5, 1fr); margin: 14px 0; }
.info-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 14px 0; font-size: 14px; }
.info-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.pay { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.pay img { width: 100%; border-radius: 12px; background: #fff; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-row span { color: var(--muted); }
.pay-row b { text-align: right; }
.copy { background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 6px; padding: 1px 8px; margin-left: 6px; cursor: pointer; font: inherit; font-size: 12px; }
.warn { color: var(--gold); font-size: 13px; margin: 12px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--green);
  color: #04140c; font-weight: 700; padding: 10px 18px; border-radius: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 16px; }
  h1 { font-size: 32px; }
  .types { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .steps { grid-template-columns: 1fr; }
  .pay { grid-template-columns: 1fr; }
  .pay img { max-width: 240px; margin: 0 auto; display: block; }
  .m-content .specs { grid-template-columns: repeat(3, 1fr); }
  .check { margin-left: 0; }
  .filters select { flex: 1 1 45%; }
}

/* ===== Tài khoản, nạp tiền, mua bằng số dư ===== */
.user-area { display: flex; align-items: center; gap: 8px; }
.nav + .user-area { margin-left: 0; }
.balance { display: inline-flex; align-items: center; gap: 8px; background: rgba(245,196,81,.12); color: var(--gold);
  border: 1px solid rgba(245,196,81,.35); border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 800; cursor: pointer; }
.balance span { font-size: 12px; background: var(--gold); color: #1a1300; border-radius: 6px; padding: 1px 6px; }
.balance:hover { border-color: var(--gold); }
.user-btn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.btn-block { width: 100%; }
.btn.loading { opacity: .6; pointer-events: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.gold { color: var(--gold); }
.bad-text { color: var(--red); }
.code { letter-spacing: .06em; color: var(--gold); }
.pre { white-space: pre-wrap; font-weight: 500; }
.link { color: var(--gold); font-weight: 600; }
.form-error { background: rgba(255,93,115,.12); border: 1px solid rgba(255,93,115,.4); color: #ff9aa8;
  border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 0; }
.toast.bad { background: var(--red); color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.m-content.auth-form { max-width: 420px; margin: 0 auto; }
.auth-form h3 { margin: 0; }
.auth-form p { margin: 0; }
.auth-form label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form input, .field input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font: inherit; font-weight: 400; }
.auth-form input:focus, .field input:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.field { margin: 14px 0; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px 6px;
  font: inherit; font-weight: 700; cursor: pointer; }
.preset:hover { border-color: var(--gold); }
.preset.on { border-color: var(--gold); background: rgba(245,196,81,.12); color: var(--gold); }

.waiting { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px dashed var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-mark { width: 60px; height: 60px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(47,208,138,.15); color: var(--green); font-size: 30px; font-weight: 800; }
.cred { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin-top: 12px; }
.cred .pay-row:last-child { border-bottom: 0; }

.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-right: 36px; }
.acct-head h3 { margin: 0; }
.acct-actions { display: flex; gap: 8px; }
.mini-tabs .tab { padding: 7px 14px; font-size: 14px; }
.order { padding: 10px 14px; }
.order summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.order summary .muted { margin-left: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: var(--bg2); color: var(--muted); font-weight: 600; font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.icon-btn { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.icon-btn:hover { border-color: var(--gold); }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st-pending { background: rgba(245,196,81,.15); color: var(--gold); }
.st-paid { background: rgba(47,208,138,.15); color: var(--green); }
.st-cancelled { background: rgba(152,162,204,.15); color: var(--muted); }

@media (max-width: 640px) {
  .user-btn { max-width: 90px; }
  .logo span:last-child { display: none; }
  .presets { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Số lượng còn lại ===== */
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price-line .price-row { margin-top: 0; }
.qty { font-size: 13px; font-weight: 700; color: var(--green); white-space: nowrap; }
.qty.low { color: var(--gold); }
.qty.out { color: var(--muted); }
