:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --bg-alt: #131722;
  --panel: #151a25;
  --border: #232a38;
  --text: #e7ebf3;
  --muted: #8b96a8;
  --accent: #6fe8c8;
  --accent-dark: #45c9a8;
  --accent2: #9b8cf2;
  --danger: #ff6b6b;
  --success: #4ade80;
  --warn: #f5b95c;
  --row-hover: #1a2130;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 20, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.brand span { background: linear-gradient(120deg, var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 22px; flex: 1; height: 100%; }
.tabs a {
  color: var(--muted); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; height: 100%;
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.wallet-summary {
  font-weight: 700; font-size: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-accent { background: linear-gradient(120deg, var(--accent2), var(--accent)); color: #0b0e14; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; margin-top: 14px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 13px; }

.container { max-width: 1000px; margin: 0 auto; padding: 28px 20px 70px; }

.hero {
  text-align: center;
  padding: 44px 20px 32px;
}
.hero h1 { font-size: 30px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.hero-search { max-width: 480px; margin: 0 auto; }

.banner {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid;
}
.banner-warn { background: rgba(245, 185, 92, .08); border-color: rgba(245, 185, 92, .35); color: var(--warn); }
.banner-danger { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); color: var(--danger); }
.banner code { background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 5px; }

.search-row { margin-bottom: 8px; }

input[type=text], input[type=tel], input[type=password] {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111, 232, 200, .15); }

select {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
select:focus { outline: none; border-color: var(--accent); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 30px 0 10px; display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 0; }

.list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); }
.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--row-hover); }
.list-row-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.list-row-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-tier {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: #0b0e14; background: var(--accent); padding: 2px 7px; border-radius: 999px; flex-shrink: 0;
}
.list-row-badge { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.list-row-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.list-row-price { font-weight: 700; font-size: 15px; color: var(--accent); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.kv-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--muted); }

.empty-state { color: var(--muted); padding: 44px 0; text-align: center; font-size: 14px; }

.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-card {
  background: var(--panel); border-radius: 16px; padding: 26px; max-width: 380px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.5); border: 1px solid var(--border);
}
.modal-card h2 { margin: 0 0 6px; font-size: 18px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

.topup-option {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--bg-alt);
}
.topup-option .stars { font-weight: 700; }
.topup-option .gram { color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 10px; }
  .tabs { order: 3; width: 100%; height: auto; gap: 18px; }
  .tabs a { height: 30px; }
  .hero h1 { font-size: 24px; }
  .list-row-badge { display: none; }
}
