:root {
  --bg: #07090f;
  --panel: #121826;
  --line: #24324a;
  --text: #e6edf9;
  --muted: #9db0cf;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --side-nav-w: 172px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-left: var(--side-nav-w);
  color: var(--text);
  font-family: "Press Start 2P", monospace;
  background: radial-gradient(circle at top, #121a2a 0%, var(--bg) 60%);
}

.side-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--side-nav-w);
  z-index: 50;
  background: linear-gradient(180deg, #0d1424 0%, #07090f 100%);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  overflow-y: auto;
}

.side-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-nav-link {
  font-family: inherit;
  font-size: 9px;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  padding: 10px 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.side-nav-link:hover {
  color: var(--text);
  border-color: #3b4a63;
  background: #131b2d;
}

.app h2 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
  font-weight: normal;
  letter-spacing: 1px;
}

.how h2 {
  margin-top: 0;
}

.section-head h2 {
  margin-bottom: 0;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: linear-gradient(to right, #ffffff 1px, transparent 1px), linear-gradient(to bottom, #ffffff 1px, transparent 1px);
  background-size: 4px 4px;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.btn-x-social {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #3b4a63;
  background: #141d2f;
  color: var(--text);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-x-social:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: #1a2438;
}

.btn-x-logo {
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
}

.footer-copy {
  margin: 0;
  font-size: 9px;
  color: var(--muted);
}

.contracts-block.panel-contracts {
  padding: 16px;
}

.ca-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  background: #0a0f19;
  border: 1px solid #27354d;
  border-radius: 8px;
}

.ca-label {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--accent-2);
}

.ca-value {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 9px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}

.btn-copy-ca {
  flex-shrink: 0;
}

.contracts-explorer-wrap {
  margin: 0;
}

.contracts-explorer-link {
  font-size: 9px;
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.contracts-explorer-link:hover {
  color: #7cedff;
}

.contracts-explorer-link.is-disabled {
  pointer-events: none;
  color: var(--muted);
  text-decoration: none;
}

.ghost-lab-section.panel-inner {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed #32435f;
  background: #0b1322;
  border-radius: 8px;
}

.ghost-lab-section .creator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.ghost-lab-section .creator-controls {
  grid-column: 1;
  justify-self: start;
  width: 100%;
  max-width: 420px;
  margin: 0;
}

.ghost-lab-section .creator-preview-wrap {
  grid-column: 2;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.creator-hint {
  margin-bottom: 12px;
}

.creator-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.creator-controls {
  display: grid;
  gap: 10px;
}

.creator-field {
  display: grid;
  gap: 6px;
  font-size: 8px;
  color: var(--muted);
}

.ghost-lab-section .creator-field select {
  max-width: 420px;
}

.creator-field select {
  width: 100%;
  max-width: 280px;
  border: 1px solid #31425f;
  background: #09101c;
  color: var(--text);
  padding: 8px;
  font-family: inherit;
  font-size: 9px;
}

.creator-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.creator-field-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

.creator-field-row select {
  flex: 1;
  min-width: 140px;
  max-width: 280px;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .ghost-lab-section .creator-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    justify-items: center;
  }

  .ghost-lab-section .creator-controls {
    grid-column: 1;
    justify-self: center;
    max-width: 440px;
  }

  .ghost-lab-section .creator-preview-wrap {
    grid-column: 1;
    justify-self: center;
    justify-content: center;
  }

  .ghost-preview.creator-preview.ghost-preview--large {
    width: min(480px, 92vw);
    max-width: min(480px, 92vw);
  }
}

@media (max-width: 768px) {
  body {
    padding-left: 0;
    padding-top: 58px;
  }

  .side-nav {
    width: 100%;
    height: auto;
    bottom: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
  }

  .side-nav-inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
  }

  .side-nav-link {
    font-size: 8px;
    padding: 7px 10px;
    flex: 0 0 auto;
  }
}

.panel {
  background: linear-gradient(180deg, #121826 0%, #0f1522 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 0 0 2px #0a101c inset;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.feature-card {
  border: 1px solid #2f3f5d;
  background: #0d1526;
  border-radius: 8px;
  padding: 12px;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 11px;
  color: #d5dcff;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}

.routing-block {
  margin-top: 20px;
}

.routing-block h2 {
  margin-top: 0;
}

.routing-lead {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.9;
  margin: 0 0 14px;
}

.stats-router strong.mono-addr {
  font-weight: normal;
  word-break: break-all;
}

.stats-router a.explorer-link {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stats-router a.explorer-link:hover {
  color: #7cedff;
}

.why-v2 {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.why-v2 h3 {
  margin: 0 0 10px;
  font-size: 10px;
  color: #d5dcff;
}

.why-v2 p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.95;
}

.why-v2 p strong {
  color: #c9d6f5;
}

.hint.tight {
  margin-bottom: 0;
}

.hero h1 {
  margin: 6px 0 2px;
  letter-spacing: 2px;
  font-size: 34px;
  line-height: 1.25;
}

.badge {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
}

.subtitle { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.subtitle span { color: #facc15; }

.hero-actions { display: flex; gap: 10px; margin-top: 12px; }
.hero-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.hero-strip img {
  width: 100%;
  border: 1px solid #354664;
  image-rendering: pixelated;
  border-radius: 4px;
}

.btn {
  border: 1px solid #3b4a63;
  background: #1a2438;
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 10px;
  line-height: 1.3;
}

.btn:hover { border-color: var(--accent); }
.btn.ghost { background: #141d2f; }
.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status { color: var(--muted); margin: 10px 0 0; font-size: 10px; line-height: 1.4; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  border: 1px solid #3b4a63;
  background: #131b2d;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
}
.tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: #1c2840;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.grid-two {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.stats {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 10px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed #2a3951;
  padding-bottom: 4px;
}
.stats strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.mint-box, .inspect-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

input {
  border: 1px solid #31425f;
  background: #09101c;
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  width: 110px;
  font-size: 10px;
}

.ghost-preview {
  margin-top: 12px;
  border: 1px solid #27354d;
  display: grid;
  place-items: center;
  min-height: 220px;
  background: #0a0f19;
}

.ghost-preview img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

/* Ghost Lab creator: fill frame (overrides .ghost-preview img 200×200) */
.ghost-preview.creator-preview.ghost-preview--large {
  margin: 0;
  margin-top: 0;
  box-sizing: border-box;
  width: min(480px, 100%);
  max-width: 480px;
  aspect-ratio: 1 / 1;
  min-height: unset;
  display: grid;
  grid-template: 1fr / 1fr;
  padding: clamp(4px, 1.2vw, 10px);
  place-items: stretch;
}

.ghost-preview.creator-preview.ghost-preview--large img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
}

.traits {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.traits li {
  padding: 4px 0;
  border-bottom: 1px dotted #2d3b53;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.section-head p { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 0 0 10px; }
.paging {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid #2a3750;
  background: #0d1422;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }

.card img {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}

.card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.card small {
  display: block;
  margin-top: 6px;
  color: #89a1c3;
  font-size: 8px;
  line-height: 1.4;
}
.how {
  margin: 16px 0;
  border: 1px dashed #32435f;
  background: #0b1322;
  padding: 12px;
}
.how p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.mini-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  border: 1px solid #344965;
  background: #111a2b;
  padding: 6px 8px;
  font-size: 10px;
}

@media (max-width: 900px) {
  .grid-two { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
}
