/* ==========================================================================
   Bloop — pure CSS3 (no frameworks). Mobile-first, premium neon graffiti vibe.
   Palette: #3D1A78 purple · #00E5FF cyan · #0A0B12 navy · neon accents
   ========================================================================== */

:root {
  --bg: #0a0b12;
  --bg-elevated: #12141f;
  --bg-card: #161826;
  --bg-card-hover: #1c1f32;
  --purple: #3d1a78;
  --purple-bright: #6b3fd4;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.15);
  --pink: #ff2e9f;
  --green: #39ff14;
  --yellow: #ffe600;
  --text: #f5f7fa;
  --text-muted: #9aa3b5;
  --text-dim: #6b7385;
  --border: rgba(0, 229, 255, 0.12);
  --border-strong: rgba(0, 229, 255, 0.28);
  --danger: #ff4d6a;
  --success: #2ee59d;
  --warning: #ffc14d;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-glow: 0 0 24px rgba(0, 229, 255, 0.18);
  --shadow-purple: 0 0 32px rgba(61, 26, 120, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 26, 120, 0.45), transparent),
    radial-gradient(ellipse 40% 30% at 90% 10%, rgba(0, 229, 255, 0.08), transparent),
    radial-gradient(ellipse 30% 25% at 10% 80%, rgba(255, 46, 159, 0.06), transparent);
  background-attachment: fixed;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Layout shell ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* ---------- Nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 11, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topnav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
  border: 2px solid rgba(0, 229, 255, 0.5);
}

.brand-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}

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

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  background: rgba(10, 11, 18, 0.96);
  padding: 24px 16px;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer.open {
  display: flex;
}

.mobile-drawer .nav-link {
  font-size: 1.1rem;
  padding: 14px 16px;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
  .mobile-drawer {
    display: none !important;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-bright) 0%, var(--purple) 55%, #1a0a3a 100%);
  color: #fff;
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible {
  box-shadow: 0 0 32px rgba(0, 229, 255, 0.35), var(--shadow-purple);
}

.btn-cyan {
  background: var(--cyan);
  color: #041018;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}

.btn-cyan:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--cyan);
}

.btn-danger {
  background: rgba(255, 77, 106, 0.15);
  border-color: rgba(255, 77, 106, 0.4);
  color: #ff8fa3;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Wallet chip ---------- */
.wallet-chip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.wallet-chip.visible {
  display: flex;
}

.wallet-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.wallet-chip .addr {
  font-family: var(--mono);
  color: var(--cyan);
}

.wallet-chip .bal {
  color: var(--text-muted);
  font-size: 0.8rem;
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

/* ---------- Views ---------- */
main {
  flex: 1;
  padding-bottom: calc(32px + var(--safe-bottom));
}

.view {
  display: none;
}

.view.active {
  display: block;
  /* Opacity-only fade — transform breaks mobile canvas measurement */
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 28px 0 20px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    padding: 24px 0 12px;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-strong);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--cyan), #7cf7ff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 36ch;
  margin-bottom: 22px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.stat-pill {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  min-width: 110px;
}

.stat-pill .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.stat-pill .value {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.hero-visual {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-glow), var(--shadow-purple);
  background: var(--bg-card);
  aspect-ratio: 16 / 11;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 11, 18, 0.55));
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-height: 40px;
}

.tab.active {
  background: linear-gradient(135deg, var(--purple-bright), var(--purple));
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* Token grid — auto-fill keeps empty tracks so 1 card stays card-width (not full row) */
.token-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  justify-content: start;
  align-items: start;
}

@media (min-width: 560px) {
  .token-grid {
    /* ~2–3 columns; empty columns remain so a lone card does not stretch */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (min-width: 900px) {
  .token-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.token-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  cursor: pointer;
  text-align: left;
  width: 100%;
  max-width: 100%;
  color: inherit;
  min-width: 0;
}

/* Empty / loading rows still span full grid width */
.token-grid > .empty-state,
.token-grid > .loading-state {
  grid-column: 1 / -1;
}

.token-card:hover,
.token-card:focus-visible {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  outline: none;
}

.token-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.token-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.token-meta {
  min-width: 0;
  flex: 1;
}

.token-meta h3 {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-meta .sym {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.85rem;
}

.token-meta .desc {
  color: var(--text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.token-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-stat .k {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-stat .v {
  font-weight: 700;
  font-size: 0.9rem;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-bright), var(--cyan));
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-live {
  background: rgba(46, 229, 157, 0.15);
  color: var(--success);
}

.badge-hot {
  background: rgba(255, 46, 159, 0.15);
  color: var(--pink);
}

.badge-migrated {
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
}

.badge-official {
  background: linear-gradient(135deg, rgba(107, 63, 212, 0.35), rgba(0, 229, 255, 0.2));
  color: #e8d6ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

/* Empty / loading */
.empty-state,
.loading-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
  margin: 0;
  flex-shrink: 0;
}

.spinner-inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
  margin: 0;
  display: inline-block;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Token detail on-chain loading */
.td-loadable.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-weight: 600;
  min-height: 1.2em;
}

.td-loadable.is-loading .td-loading-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.chart-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 11, 18, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.chart-loading.hidden {
  display: none;
}

.tx-list .tx-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.04);
}

.token-detail-header.is-loading #td-name,
.token-detail-header.is-loading #td-symbol,
.token-detail-header.is-loading #td-desc {
  opacity: 0.85;
}

.token-detail-header .header-loading {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
}

.token-detail-header.is-loading .header-loading {
  display: inline-flex;
}

#td-trade-card.is-loading {
  position: relative;
}

#td-trade-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(10, 11, 18, 0.35);
  pointer-events: all;
  z-index: 1;
}

#btn-trade:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Partners */
.partners {
  position: relative;
}

.partners-card {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow-purple);
}

.partners-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #0a0b12;
}

.partners-copy {
  padding: 20px;
}

.partners-copy h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.partners-copy p {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.partner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.partner-tag {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.partner-tag.bloop {
  color: #c9a0ff;
  border-color: rgba(107, 63, 212, 0.5);
}
.partner-tag.pepe {
  color: #7dff9a;
}
.partner-tag.shiba {
  color: #ffb347;
}
.partner-tag.cat {
  color: #d4a0ff;
}
.partner-tag.bird {
  color: var(--yellow);
}

/* How it works */
.steps {
  display: grid;
  gap: 12px;
}

@media (min-width: 700px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--cyan-dim);
  color: var(--cyan);
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Contracts ---------- */
.contracts-hero {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 28px 0 8px;
}

@media (min-width: 800px) {
  .contracts-hero {
    grid-template-columns: 1.4fr 0.6fr;
    gap: 36px;
    padding: 32px 0 12px;
  }
}

.hero-badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-strong);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.contracts-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.contracts-hero h1 .grad {
  background: linear-gradient(90deg, var(--cyan), #7cf7ff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contracts-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 54ch;
  margin-bottom: 12px;
  line-height: 1.55;
}

.contracts-lead-soft {
  font-size: 0.98rem;
  opacity: 0.95;
  margin-bottom: 18px;
}

.contracts-note {
  font-size: 0.88rem;
  margin: 12px 0 4px;
  line-height: 1.45;
}

.contract-addr-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.faq-item {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.25rem;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-body {
  padding: 0 18px 16px;
}

.faq-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.faq-body a {
  font-weight: 600;
}

.contracts-footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.contracts-footer-cta h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.contracts-footer-cta p {
  margin: 0;
}

.contracts-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contracts-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contracts-hero-visual img {
  width: min(200px, 55vw);
  height: auto;
  border-radius: 50%;
  border: 3px solid rgba(0, 229, 255, 0.45);
  box-shadow: var(--shadow-glow), var(--shadow-purple);
}

.contracts-section-head {
  margin-top: 28px;
}

.contract-cards {
  display: grid;
  gap: 14px;
}

@media (min-width: 800px) {
  .contract-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.contract-card {
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.contract-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.contract-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.contract-card-top h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.contract-card-top p {
  font-size: 0.9rem;
  margin: 0;
}

.contract-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-dim);
  border: 1px solid var(--border-strong);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contract-addr-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.contract-addr-box:first-of-type {
  margin-top: 0;
}

.contract-addr-box-proxy {
  background: rgba(61, 26, 120, 0.2);
  border-color: rgba(107, 63, 212, 0.35);
}

.contract-addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan);
  word-break: break-all;
  line-height: 1.4;
}

.contract-addr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.security-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .security-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .security-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.security-item {
  transition: border-color 0.15s, transform 0.12s;
  min-height: 100%;
}

.security-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.security-item h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text);
}

.security-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.testing-panel {
  margin-bottom: 32px;
}

.testing-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.testing-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.55;
}

.testing-intro strong {
  color: var(--text);
}

.testing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.testing-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.testing-list strong {
  color: var(--cyan);
  font-size: 0.92rem;
}

.testing-list span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.testing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Explore ---------- */
.explore-toolbar {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.explore-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.explore-search-row .input {
  flex: 1 1 200px;
  min-width: 0;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.view-btn {
  min-height: 36px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
}

.view-btn.active {
  background: linear-gradient(135deg, var(--purple-bright), var(--purple));
  color: #fff;
  border-color: rgba(0, 229, 255, 0.3);
}

.explore-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 700px) {
  .explore-filters {
    grid-template-columns: repeat(3, 1fr) auto;
    align-items: end;
  }
}

@media (min-width: 1000px) {
  .explore-filters {
    grid-template-columns: repeat(5, 1fr) auto;
  }
}

.filter-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.filter-field .input,
.filter-field select.input {
  min-height: 42px;
  padding: 8px 12px;
}

.filter-field select.input {
  appearance: auto;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
}

.explore-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.explore-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.explore-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

.explore-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.explore-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.explore-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.explore-table tbody tr:hover,
.explore-table tbody tr:focus-within {
  background: var(--bg-card-hover);
}

.explore-table .tok-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.explore-table .tok-cell img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.explore-table .tok-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.explore-table .sym {
  color: var(--cyan);
  font-weight: 700;
}

.explore-table .mono {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explore-table .progress {
  min-width: 80px;
  max-width: 120px;
}

/* ---------- Create form ---------- */
.page-title {
  padding: 24px 0 8px;
}

.page-title h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-title p {
  color: var(--text-muted);
  margin-top: 6px;
}

.create-layout {
  display: grid;
  gap: 20px;
  padding-bottom: 32px;
  min-width: 0;
}

@media (min-width: 900px) {
  .create-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: start;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.input,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

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

.file-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  background: rgba(0, 229, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.file-drop input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.file-drop .preview {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.fee-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(61, 26, 120, 0.35);
  border: 1px solid rgba(107, 63, 212, 0.4);
  margin-bottom: 14px;
}

.fee-box .label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.fee-box .value {
  font-weight: 800;
  color: var(--cyan);
  font-family: var(--mono);
}

.preview-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  align-self: start;
}

.preview-card .token-card-top {
  align-items: flex-start;
  min-width: 0;
}

.preview-card .token-meta {
  min-width: 0;
  overflow: hidden;
}

.preview-card .token-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

/* Create preview: wrap long descriptions so columns stay balanced */
#preview-desc,
.preview-card .token-meta .desc {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  max-height: 7.8em;
  margin-top: 4px;
  line-height: 1.35;
}

.curve-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.curve-preview canvas {
  width: 100%;
  height: 140px;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* ---------- Token detail ---------- */
.token-detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 20px 0 12px;
}

.token-detail-header .token-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.token-detail-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.token-detail-header .sym {
  color: var(--cyan);
  font-weight: 700;
}

.token-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.detail-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .detail-grid {
    grid-template-columns: 1.4fr 0.9fr;
    align-items: start;
  }
}

.chart-wrap {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  height: 220px;
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  min-width: 0; /* flex/grid child can shrink on mobile */
}

@media (min-width: 600px) {
  .chart-wrap {
    height: 320px;
  }
}

.chart-wrap canvas {
  display: block;
  /* size is set in JS in CSS pixels — do not force 100% (distorts bitmap on iOS) */
  vertical-align: top;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(18, 20, 31, 0.95);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  display: none;
  z-index: 2;
  white-space: nowrap;
}

.trade-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--bg);
  padding: 4px;
  border-radius: 999px;
}

.trade-tab {
  min-height: 40px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--text-muted);
}

.trade-tab.active.buy {
  background: rgba(46, 229, 157, 0.2);
  color: var(--success);
}

.trade-tab.active.sell {
  background: rgba(255, 77, 106, 0.2);
  color: #ff8fa3;
}

.trade-estimate {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0 14px;
  min-height: 1.3em;
}

.trade-estimate strong {
  color: var(--cyan);
}

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.info-row .k {
  color: var(--text-muted);
}

.info-row .v {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.tx-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.tx-item .side-buy {
  color: var(--success);
  font-weight: 800;
}

.tx-item .side-sell {
  color: #ff8fa3;
  font-weight: 800;
}

.tx-item .muted {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 calc(24px + var(--safe-bottom));
  margin-top: auto;
  background: rgba(0, 0, 0, 0.25);
}

.footer-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.footer-brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.4);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.footer-col a,
.footer-col button {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px 0;
  text-align: left;
}

.footer-col a:hover,
.footer-col button:hover {
  color: var(--cyan);
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-partners-thumb {
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Official X / community link */
.x-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan) !important;
  font-weight: 700;
  text-decoration: none !important;
}

.x-link:hover,
.x-link:focus-visible {
  color: #7cf7ff !important;
  text-decoration: underline !important;
}

.x-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--border-strong);
  font-size: 0.95rem;
  line-height: 1;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-bottom .x-link {
  font-size: 0.85rem;
}

/* ---------- Toasts ---------- */
.toast-host {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 12px;
  left: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
  margin-left: auto;
}

.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-size: 0.9rem;
  animation: toastIn 0.25s ease;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.toast.success {
  border-color: rgba(46, 229, 157, 0.45);
}
.toast.error {
  border-color: rgba(255, 77, 106, 0.45);
}
.toast.info {
  border-color: rgba(0, 229, 255, 0.4);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Modal (disconnect confirm etc.) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-glow);
}

.modal h3 {
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mono {
  font-family: var(--mono);
}

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

.text-cyan {
  color: var(--cyan);
}

.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mb-1 {
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

/* Demo banner */
.demo-banner {
  background: linear-gradient(90deg, rgba(61, 26, 120, 0.6), rgba(0, 229, 255, 0.15));
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.demo-banner strong {
  color: var(--cyan);
}

/* About strip */
.about-strip {
  display: grid;
  gap: 16px;
  align-items: center;
}

@media (min-width: 800px) {
  .about-strip {
    grid-template-columns: 1fr 1fr;
  }
}

.about-strip img {
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-purple);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
