:root {
  color-scheme: dark;
  --bg: #060606;
  --bg-elev: #0d0d0f;
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-border-hover: rgba(255, 255, 255, 0.22);
  --input-bg: rgba(255, 255, 255, 0.04);
  --text: #f5f5f5;
  --text-dim: #a3a3a3;
  --text-muted: #6b6b6b;
  --white: #ffffff;
  --success: #4ade80;
  --success-dim: rgba(74, 222, 128, 0.12);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.12);
  --radius: 14px;
  --radius-pill: 999px;
  --transition: 0.18s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(255, 255, 255, 0.07), transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% 20%, rgba(255, 255, 255, 0.04), transparent 60%),
    radial-gradient(ellipse 45% 35% at 10% 65%, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle dotted texture, like nfaccount's footer pattern */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, transparent 55%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 55%, black 100%);
}

.app { position: relative; z-index: 1; }

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 12px 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 14px;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2b2b2e, #101013);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.logo-text { line-height: 1.15; }
.logo-title { font-weight: 700; font-size: 15px; letter-spacing: 0.6px; }
.logo-sub { font-size: 9px; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.nav-link:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
.nav-link.active { color: var(--white); background: rgba(255, 255, 255, 0.09); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--white); color: #0a0a0a; }
.btn-primary:hover:not(:disabled) { background: #d9d9d9; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255, 255, 255, 0.12); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--card-border); }
.btn-ghost:hover:not(:disabled) { color: var(--white); border-color: var(--card-border-hover); }

.btn-success { background: var(--success-dim); color: var(--success); border-color: rgba(74, 222, 128, 0.25); }
.btn-success:hover:not(:disabled) { background: rgba(74, 222, 128, 0.2); }

.btn-danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(248, 113, 113, 0.25); }
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ── Layout ── */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }

.hero { text-align: center; padding: 84px 16px 56px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}

.hero-title {
  font-size: clamp(44px, 7.5vw, 84px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--white);
}

.hero-title .dim { color: var(--text-muted); }

.hero-sub {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-dim);
}

.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 52px;
  flex-wrap: wrap;
}

.hero-stat {
  padding: 14px 34px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}
.hero-stat:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.hero-stat:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.hero-stat + .hero-stat { border-left: none; }

.hero-stat-value { font-size: 20px; font-weight: 700; color: var(--white); }
.hero-stat-label { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; }

/* ── Marquee strip ── */
.strip {
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  padding: 14px 0;
  white-space: nowrap;
}

.strip-inner { display: inline-block; animation: marquee 30s linear infinite; }

.strip span {
  display: inline-block;
  margin: 0 34px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Sections / cards ── */
.section-title { font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -0.02em; text-align: center; color: var(--white); }
.section-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-top: 10px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  transition: var(--transition);
}

.card:hover { border-color: var(--card-border-hover); }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(145deg, #232326, #0e0e10);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.card h3 { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.card p { font-size: 13px; line-height: 1.6; color: var(--text-dim); }

/* ── Forms ── */
.form-card { max-width: 560px; margin: 0 auto; }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.form-textarea { min-height: 96px; resize: vertical; }

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-select { appearance: none; cursor: pointer; }
select.form-input, select.form-select { color-scheme: dark; }
select.form-input option, .form-select option { background: var(--bg-elev); color: var(--text); }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* ── Alerts / badges ── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.25); }
.alert-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(74, 222, 128, 0.25); }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.badge-pending { background: var(--warning-dim); color: var(--warning); }
.badge-approved, .badge-active { background: var(--success-dim); color: var(--success); }
.badge-rejected, .badge-suspended { background: var(--danger-dim); color: var(--danger); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}

.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-dim); vertical-align: top; }
.data-table td:first-child { color: var(--white); font-weight: 600; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ── Auth gate ── */
.gate { max-width: 420px; margin: 90px auto; text-align: center; }
.gate .card { padding: 36px 30px; }
.gate-icon { font-size: 34px; margin-bottom: 14px; }
.gate-title { font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.gate-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }

/* ── Panel chrome ── */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 36px 0 26px; flex-wrap: wrap; }
.panel-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--white); }
.panel-desc { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 24px;
}

.tab {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tab:hover { color: var(--white); }
.tab.active { background: var(--white); color: #0a0a0a; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--white); margin-top: 6px; }

.empty { padding: 34px; text-align: center; color: var(--text-muted); font-size: 13px; }

.footer {
  border-top: 1px solid var(--card-border);
  padding: 30px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── API Request Builder ── */
.builder-head { margin-bottom: 18px; }
.builder-head .panel-desc { margin-top: 2px; }

.grid-builder {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(240px, 300px) 1fr;
  gap: 16px;
  align-items: start;
}

.builder-col .card { padding: 20px; }
.builder-col h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.builder-col .col-count { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.4px; }

.builder-subtitle {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-muted); margin: 18px 0 10px;
}

.key-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 10px 12px;
}
.key-field code { font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 12px; color: var(--text); word-break: break-all; flex: 1; }
.icon-btn {
  flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; font-size: 13px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); color: var(--text-dim);
  transition: var(--transition);
}
.icon-btn:hover { color: var(--white); border-color: var(--card-border-hover); }

/* Option rows with toggle / segmented / amount */
.opt-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.opt-row:last-child { border-bottom: none; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--text); }
.opt-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: rgba(255,255,255,0.12); border: 1px solid var(--card-border); transition: var(--transition);
}
.switch .slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  border-radius: 50%; background: var(--text-dim); transition: var(--transition);
}
.switch input:checked + .slider { background: #4f46e5; border-color: #6366f1; }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* Segmented GET/POST */
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--card-border); border-radius: 999px; background: rgba(255,255,255,0.03); }
.seg button {
  border: none; background: transparent; color: var(--text-dim); cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 5px 12px; border-radius: 999px; transition: var(--transition);
}
.seg button.active { background: #4f46e5; color: #fff; }

.amount-field { display: flex; align-items: center; gap: 0; }
.amount-field input {
  width: 96px; text-align: left; padding: 9px 12px; font-size: 13px;
  background: var(--input-bg); border: 1px solid var(--card-border); border-radius: 10px;
  color: var(--text); font-family: inherit;
}
.amount-field input:focus { outline: none; border-color: rgba(255,255,255,0.4); }

/* Game selection */
.game-item {
  border: 1px solid var(--card-border); border-radius: 12px; padding: 13px 15px;
  cursor: pointer; transition: var(--transition); margin-bottom: 10px; background: rgba(255,255,255,0.02);
}
.game-item:hover { border-color: var(--card-border-hover); }
.game-item.open { border-color: #6366f1; background: rgba(79,70,229,0.08); }
.game-item .game-name { font-size: 14px; font-weight: 700; color: var(--white); }
.game-item .game-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.game-item .game-count { font-size: 11px; color: var(--text-dim); margin-top: 5px; }

.variant-list { margin-top: 10px; }
.variant-subtitle {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-muted); margin: 6px 2px 8px;
}
.variant-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--card-border); border-radius: 10px; padding: 11px 14px;
  cursor: pointer; transition: var(--transition); margin-bottom: 6px;
}
.variant-item:hover { border-color: var(--card-border-hover); }
.variant-item.active { background: #4f46e5; border-color: #6366f1; }
.variant-item.active .variant-name, .variant-item.active .variant-price { color: #fff; }
.variant-name { font-size: 13px; font-weight: 600; color: var(--text); }
.variant-price { font-size: 13px; font-weight: 700; color: var(--success); }

/* Endpoint cards (right column) */
.endpoint { margin-bottom: 20px; }
.endpoint-title { font-size: 12.5px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: 'SFMono-Regular', ui-monospace, monospace;
  font-size: 11px; color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border); border-radius: 8px; padding: 6px 9px; word-break: break-all;
}
.chip b { color: #a5b4fc; font-weight: 700; }
.method-pill {
  flex: none; font-family: inherit; font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  padding: 3px 8px; border-radius: 6px;
}
.method-get { background: rgba(74,222,128,0.16); color: var(--success); }
.method-post { background: rgba(79,70,229,0.22); color: #a5b4fc; }
.endpoint-line {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 9px 11px; cursor: pointer; transition: var(--transition);
}
.endpoint-line:hover { border-color: var(--card-border-hover); }
.endpoint-line code { font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 11.5px; color: var(--text); word-break: break-all; flex: 1; }
.code-block {
  font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 11.5px; line-height: 1.55;
  background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 12px 13px; color: var(--text); white-space: pre; overflow-x: auto; margin-top: 8px; cursor: pointer;
}
.code-block:hover { border-color: var(--card-border-hover); }
.endpoint-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.endpoint-note .dot-sm { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(74,222,128,0.7); }

/* ── API Builder refresh ── */
.builder-col .card {
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.07), transparent 130px),
    var(--card);
  border-color: rgba(99, 102, 241, 0.16);
}
.builder-col .card:hover { border-color: rgba(99, 102, 241, 0.38); }
.builder-col h3 {
  padding-bottom: 13px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.col-badge {
  flex: none;
  width: 26px; height: 26px;
  display: inline-grid; place-items: center;
  margin-right: 10px;
  font-size: 11px; font-weight: 800;
  color: #c7d2fe;
  background: rgba(79, 70, 229, 0.22);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 8px;
}
.builder-col h3 .col-title { flex: 1; display: flex; align-items: center; }
.builder-subtitle { color: #a5b4fc; }
.key-field { border-color: rgba(99, 102, 241, 0.3); background: rgba(79, 70, 229, 0.07); }
.endpoint {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}
.endpoint:hover { border-color: rgba(99, 102, 241, 0.35); }
.endpoint-title::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: #6366f1;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}

@media (max-width: 980px) {
  .grid-builder { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding-top: 56px; }
}
