/* ── Night Fun — ZK Token Launchpad ─────────────────────────── */
:root {
  --bg:      #050308;
  --surface: #0d0a1a;
  --raised:  #120f20;
  --depth:   #080511;
  --ink:     #7c3aed;
  --glow:    #a78bfa;
  --plasma:  #c084fc;
  --green:   #00d68f;
  --red:     #ef4444;
  --gold:    #f5c518;
  --cyan:    #06b6d4;
  --rim:     rgba(255,255,255,.07);
  --rim2:    rgba(255,255,255,.12);
  --text:    #f1f0f5;
  --text2:   #9ca3af;
  --muted:   #4b5563;
  --faint:   #374151;
  --sans:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'Fira Code', monospace;
  --serif:   'Playfair Display', Georgia, serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,3,8,.92);
  border-bottom: 1px solid var(--rim);
  backdrop-filter: blur(16px);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px; height: 56px;
}
.nav-logo {
  font-family: var(--serif); font-size: 20px;
  font-style: italic; cursor: pointer;
}
.nav-logo span { color: var(--glow); }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; transition: all .18s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #6d28d9; }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--rim2); }
.btn-ghost:hover { color: var(--text); border-color: var(--glow); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-green { background: var(--green); color: #000; border-color: var(--green); }
.btn-green:hover { opacity: .9; }
.btn-red { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.btn-red:hover { background: rgba(239,68,68,.25); }

/* ── Layout ──────────────────────────────────────────────────── */
.page-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 40px 24px;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center; margin-bottom: 40px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  background: rgba(6,182,212,.08); color: var(--cyan);
  border: 1px solid rgba(6,182,212,.2);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 18px; letter-spacing: .05em;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 60px);
  font-style: italic; line-height: 1.05;
  margin-bottom: 14px;
}
.hero h1 em { color: var(--glow); }
.hero p {
  font-size: 15px; color: var(--text2); max-width: 500px;
  margin: 0 auto 24px; line-height: 1.8; font-weight: 300;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Stats strip ─────────────────────────────────────────────── */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 14px; overflow: hidden; margin-bottom: 28px;
}
.stat-cell {
  padding: 14px 10px; text-align: center;
  border-right: 1px solid var(--rim);
}
.stat-cell:last-child { border-right: none; }
.stat-val { font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); }
.stat-lbl { font-size: 9px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }

/* ── Tab bar ─────────────────────────────────────────────────── */
.tabs-bar {
  display: flex; gap: 4px; background: var(--surface);
  border: 1px solid var(--rim); border-radius: 14px;
  padding: 5px; margin-bottom: 24px;
}
.tab {
  flex: 1; padding: 9px 6px; text-align: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  border-radius: 10px; cursor: pointer; transition: all .2s;
  color: var(--muted); white-space: nowrap; letter-spacing: .3px;
}
.tab:hover { color: var(--text2); background: var(--raised); }
.tab.active { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.3); }

/* ── Discover layout ─────────────────────────────────────────── */
.discover-layout {
  display: grid; grid-template-columns: 1fr 240px;
  gap: 18px; align-items: start;
}
.token-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.token-card {
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 14px; padding: 16px; cursor: pointer;
  transition: all .2s; position: relative; overflow: hidden;
}
.token-card:hover { border-color: var(--rim2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.token-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--ink), var(--cyan));
  opacity: 0; transition: opacity .2s;
}
.token-card:hover::before { opacity: 1; }
.tc-emoji { font-size: 28px; margin-bottom: 8px; }
.tc-name { font-weight: 800; font-size: 13px; margin-bottom: 2px; }
.tc-symbol { font-size: 10px; font-family: var(--mono); color: var(--cyan); margin-bottom: 8px; }
.tc-desc { font-size: 11px; color: var(--text2); line-height: 1.55; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-stats { display: flex; justify-content: space-between; font-size: 9px; font-family: var(--mono); color: var(--muted); margin-bottom: 8px; }
.tc-stat-green { color: var(--green); }
.tc-stat-gold { color: var(--gold); }
.tc-bar-wrap { background: var(--depth); border-radius: 4px; height: 4px; overflow: hidden; }
.tc-bar { height: 100%; background: linear-gradient(90deg, var(--ink), var(--cyan)); border-radius: 4px; transition: width .4s; }
.tc-bar-label { font-size: 8px; font-family: var(--mono); color: var(--muted); margin-top: 3px; text-align: right; }
.tc-zk-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 8px; font-family: var(--mono); font-weight: 700;
  background: rgba(124,58,237,.15); color: var(--glow);
  border: 1px solid rgba(124,58,237,.3); padding: 2px 6px; border-radius: 5px;
  letter-spacing: .05em;
}

/* ── Live feed ───────────────────────────────────────────────── */
.live-panel {
  background: var(--surface); border: 1px solid var(--rim);
  border-radius: 16px; padding: 14px;
  position: sticky; top: 70px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.live-head {
  font-size: 9px; font-weight: 700; font-family: var(--mono);
  color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }
.live-item { padding: 7px 0; border-bottom: 1px solid var(--rim); font-size: 10px; line-height: 1.6; }
.live-item:last-child { border-bottom: none; }
.live-buy { color: var(--green); font-weight: 700; }
.live-sell { color: var(--red); font-weight: 700; }
.live-anon { color: var(--plasma); font-family: var(--mono); }
.live-sym { color: var(--cyan); font-family: var(--mono); font-weight: 700; }
.live-time { font-size: 9px; color: var(--faint); font-family: var(--mono); display: block; margin-top: 1px; }

/* ── Create / Launch ─────────────────────────────────────────── */
.create-wrap { max-width: 680px; margin: 0 auto; }
.card {
  background: var(--surface); border: 1px solid var(--rim2);
  border-radius: 18px; padding: 28px; margin-bottom: 20px;
}
.card-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.card-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; font-weight: 300; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--text2); text-transform: uppercase; letter-spacing: .8px; }
.input {
  background: var(--raised); border: 1px solid var(--rim2);
  border-radius: 10px; padding: 10px 14px;
  color: var(--text); font-family: var(--sans); font-size: 13px;
  outline: none; width: 100%; transition: border-color .18s;
}
.input:focus { border-color: var(--glow); }
.input::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.circuit-log {
  background: var(--depth); border: 1px solid var(--rim);
  border-radius: 10px; padding: 12px;
  font-family: var(--mono); font-size: 10px; line-height: 1.9;
  color: var(--muted); margin-top: 16px;
}
.ct-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.ct-dot.wait { background: var(--faint); }
.ct-dot.active { background: var(--cyan); animation: pulse 1s infinite; }
.ct-dot.done { background: var(--green); }
.result-box {
  display: none;
  background: linear-gradient(135deg, rgba(6,182,212,.07), rgba(124,58,237,.05));
  border: 1px solid rgba(6,182,212,.25);
  border-radius: 16px; padding: 24px; margin-top: 18px; position: relative;
}
.result-box::before { content:''; position:absolute; top:0; left:0; right:0; height:1px; background: linear-gradient(90deg,transparent,var(--cyan),transparent); }
.result-addr {
  font-size: 11px; font-family: var(--mono); color: var(--cyan);
  word-break: break-all; background: rgba(0,0,0,.25);
  border: 1px solid var(--rim); border-radius: 8px;
  padding: 8px 12px; margin: 8px 0;
}
.result-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.result-stat { background: rgba(0,0,0,.2); border: 1px solid var(--rim); border-radius: 8px; padding: 10px; text-align: center; }
.result-stat-label { font-size: 8px; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.result-stat-val { font-size: 15px; font-weight: 800; font-family: var(--mono); }

/* ── Bonding curve ───────────────────────────────────────────── */
.curve-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.curve-stat { background: var(--raised); border: 1px solid var(--rim); border-radius: 10px; padding: 10px; text-align: center; }
.curve-stat-label { font-size: 8px; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.curve-stat-val { font-size: 14px; font-weight: 800; font-family: var(--mono); }
.grad-bar-wrap { background: var(--depth); border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: 4px; }
.grad-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--ink), var(--cyan)); transition: width .6s; }
.privacy-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--raised); border: 1px solid var(--rim2);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer;
}
.privacy-row input { margin-top: 2px; accent-color: var(--ink); }
.trade-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }

/* ── King of the Hill ────────────────────────────────────────── */
.koth-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin-bottom: 32px; }
.koth-card { border-radius: 16px; border: 1px solid var(--rim2); overflow: hidden; cursor: pointer; transition: all .25s; }
.koth-card:hover { transform: translateY(-3px); }
.koth-card.peace { background: linear-gradient(135deg, rgba(5,150,105,.06), rgba(16,185,129,.03)); }
.koth-card.peace:hover { border-color: rgba(0,214,143,.4); }
.koth-card.war   { background: linear-gradient(135deg, rgba(220,38,38,.06), rgba(239,68,68,.03)); }
.koth-card.war:hover   { border-color: rgba(244,63,94,.4); }
.koth-inner { padding: 32px 24px; }
.koth-icon { font-size: 40px; margin-bottom: 12px; }
.koth-name { font-family: var(--serif); font-size: 32px; font-style: italic; margin-bottom: 8px; }
.koth-card.peace .koth-name { color: var(--green); }
.koth-card.war   .koth-name { color: var(--red); }
.koth-desc { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 16px; font-weight: 300; }
.koth-btn { width: 100%; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; font-family: var(--sans); }
.koth-card.peace .koth-btn { background: linear-gradient(135deg, #059669, var(--green)); color: #fff; }
.koth-card.war   .koth-btn { background: linear-gradient(135deg, #dc2626, var(--red)); color: #fff; }
.koth-vs { font-family: var(--serif); font-size: 28px; font-style: italic; color: var(--muted); text-align: center; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; max-width: 340px; animation: toastIn .25s ease; }
.toast.info    { background: var(--surface); border: 1px solid var(--rim2); color: var(--text2); }
.toast.success { background: rgba(0,214,143,.12); border: 1px solid rgba(0,214,143,.3); color: var(--green); }
.toast.error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
@keyframes toastIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── Overlay / Modal ─────────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--rim2); border-radius: 20px; padding: 32px; max-width: 440px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 24px; }
.wc-icon { font-size: 40px; text-align: center; margin-bottom: 12px; }
.wc-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.wc-sub { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 20px; line-height: 1.6; }
.wc-wallet-link { display: flex; align-items: center; gap: 12px; padding: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--rim2); border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; margin-bottom: 8px; transition: border-color .18s; }
.wc-wallet-link:hover { border-color: var(--glow); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .discover-layout { grid-template-columns: 1fr; }
  .live-panel { display: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-cell:nth-child(3) { border-top: 1px solid var(--rim); }
  .stat-cell:nth-child(4) { border-top: 1px solid var(--rim); border-right: none; }
  .koth-grid { grid-template-columns: 1fr; }
  .koth-vs { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
