:root {
  --bg: #070b16;
  --bg-elev: #0e1528;
  --bg-card: #121a30;
  --border: #243056;
  --text: #e8edf8;
  --muted: #93a0bf;
  --primary: #6c8cff;
  --primary-2: #9b7bff;
  --success: #2fce8a;
  --danger: #ff6b7a;
  --info: #4db7ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(108,140,255,.18), transparent 50%),
              radial-gradient(900px 500px at 90% 0%, rgba(155,123,255,.12), transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.container.narrow { width: min(460px, calc(100% - 2rem)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: .92em; }
.grad {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Topbar / guest */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(7,11,22,.75);
  border-bottom: 1px solid rgba(36,48,86,.7);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white; font-weight: 700;
  box-shadow: 0 8px 24px rgba(108,140,255,.35);
}
.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 12px;
  padding: .7rem 1.1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white; box-shadow: 0 10px 28px rgba(108,140,255,.28);
}
.btn-secondary {
  background: rgba(255,255,255,.04);
  border-color: var(--border); color: var(--text);
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-sm { padding: .45rem .8rem; font-size: .9rem; border-radius: 10px; }
.btn-lg { padding: .9rem 1.3rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* Cards / forms */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.card-head h2, .card h2, .card h1 { margin: 0 0 .35rem; }
.feature h3 { margin-top: 0; }
.form { display: grid; gap: .9rem; margin-top: 1rem; }
.form label { display: grid; gap: .4rem; font-weight: 500; }
.form input, .form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: .75rem .9rem;
  font: inherit;
}
.form input:focus, .form select:focus {
  outline: 2px solid rgba(108,140,255,.35);
  border-color: var(--primary);
}

.alert {
  border-radius: 12px;
  padding: .85rem 1rem;
  margin: .75rem 0 1rem;
  border: 1px solid var(--border);
}
.alert-success { background: rgba(47,206,138,.1); border-color: rgba(47,206,138,.35); color: #baf5d8; }
.alert-error { background: rgba(255,107,122,.1); border-color: rgba(255,107,122,.35); color: #ffc1c8; }
.alert-info { background: rgba(77,183,255,.1); border-color: rgba(77,183,255,.35); color: #c7ebff; }

/* Hero */
.hero { padding: 4rem 0 2rem; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center;
}
.badge {
  display: inline-block; padding: .3rem .7rem; border-radius: 999px;
  background: rgba(108,140,255,.12); color: #b7c7ff; border: 1px solid rgba(108,140,255,.25);
  font-size: .85rem; font-weight: 600; margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); line-height: 1.1; margin: 0 0 1rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.hero-stats {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: flex; flex-wrap: wrap; gap: 1.25rem;
}
.hero-stats li { display: grid; }
.hero-stats strong { font-size: 1.15rem; }
.hero-stats span { color: var(--muted); font-size: .9rem; }
.hero-card { padding: 1rem; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow); }
.hero-card-head { padding: .5rem .75rem 1rem; color: var(--muted); font-weight: 600; }
.coin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.coin-pill, .coin-cell {
  display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 12px; padding: .65rem .75rem;
}
.coin-pill strong, .coin-cell strong { display: block; line-height: 1.2; }
.coin-pill small, .coin-cell small { color: var(--muted); }
.coin-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(108,140,255,.25), rgba(155,123,255,.2));
  font-weight: 700;
}
.coin-icon.sm { width: 32px; height: 32px; font-size: .9rem; }

.section { padding: 2.5rem 0 4rem; }
.section-head { margin-bottom: 1.5rem; max-width: 36rem; }
.section-head h2 { margin: 0 0 .4rem; font-size: 1.8rem; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature p { color: var(--muted); margin-bottom: 0; }

.auth-section { padding: 3rem 0 4rem; }
.auth-card h1 { margin-top: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer-inner { display: grid; gap: .75rem; }
.footer-links { display: flex; gap: 1rem; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
  background: rgba(10,15,28,.92);
  padding: 1.1rem .9rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.side-nav { display: grid; gap: .25rem; flex: 1; }
.side-nav a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: .7rem .85rem; border-radius: 12px;
}
.side-nav a:hover { background: rgba(255,255,255,.03); color: var(--text); text-decoration: none; }
.side-nav a.active {
  background: linear-gradient(135deg, rgba(108,140,255,.18), rgba(155,123,255,.12));
  color: var(--text); border: 1px solid rgba(108,140,255,.25);
}
.sidebar-foot { display: grid; gap: .55rem; }
.user-chip {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .7rem; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  font-size: .88rem; color: var(--muted);
}
.user-chip .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 4px rgba(47,206,138,.15);
}
.app-main { min-width: 0; }
.app-top { padding: 1.4rem 1.5rem .25rem; }
.app-top h1 { margin: 0; font-size: 1.55rem; }
.app-content { padding: 1rem 1.5rem 2rem; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat-value { display: block; font-size: 1.45rem; margin-top: .25rem; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: .75rem .5rem;
  border-bottom: 1px solid rgba(36,48,86,.85);
  vertical-align: middle;
}
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.tag {
  display: inline-block; padding: .2rem .5rem; border-radius: 999px;
  background: rgba(108,140,255,.12); color: #c5d3ff; font-size: .8rem; text-transform: capitalize;
}
.kv { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .7rem; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(36,48,86,.9); padding-bottom: .55rem; }
.steps { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.steps li { margin: .45rem 0; }
.copy-box {
  display: flex; gap: .5rem; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: .6rem .7rem; margin: 1rem 0;
}
.copy-box code { flex: 1; overflow: auto; font-family: var(--mono); font-size: .82rem; }
.narrow-card { max-width: 520px; }
.link { color: var(--primary); font-weight: 600; }
.success-text { color: var(--success); }
.empty-state { text-align:center; padding: 2.5rem 1.25rem; }
.ptc-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:1rem; }
.ptc-card { display:flex; flex-direction:column; margin:0; }
.ptc-card h2 { font-size:1.1rem; margin-top:.4rem; }
.ptc-card .btn { margin-top:auto; }
.ptc-view-card { max-width:650px; }
.ptc-timer { display:grid; gap:.15rem; margin:1.25rem 0; padding:1rem; border-radius:12px; background:rgba(108,140,255,.1); border:1px solid rgba(108,140,255,.3); }
.ptc-timer strong { font-family:var(--mono); font-size:1.5rem; }

@media (max-width: 960px) {
  .hero-grid, .feature-grid, .stats-grid, .grid-2, .ptc-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .side-nav { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav a:not(.btn) { display: none; }
  .coin-grid { grid-template-columns: 1fr; }
  .side-nav { grid-template-columns: 1fr 1fr; }
}

/* ---- Faucet ---- */
.faucet-progress {
  margin: .75rem 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.faucet-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .9s linear;
}
