/* ============================================================
   Token section + header chip — All Billionaires Are Bastards
   Loaded after bubble.css / bubble2d.css; reuses their CSS vars.
   ============================================================ */

html { scroll-behavior: smooth; }

/* Keyboard-focus visibility (UX refinement) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Header layout: chip + nav grouped to the right ---------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---- Header token chip --------------------------------------- */
.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.06);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 120ms, background 120ms;
}
.token-chip:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.13);
}
.token-chip[hidden] { display: none; }
.token-chip-tick {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.token-chip-price {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.token-chip-change {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.token-chip-change.up   { color: #22c55e; }
.token-chip-change.down { color: #ef4444; }
.token-chip-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: tokenPulse 2.4s infinite;
}
@keyframes tokenPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---- Token section ------------------------------------------- */
.token-section {
  background: linear-gradient(180deg, #0e1628 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  padding: 44px 24px;
}
.token-section[hidden] { display: none; }
.token-inner { max-width: 1100px; margin: 0 auto; }

.token-head { text-align: center; margin-bottom: 22px; }
.token-kicker {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.token-head h2 {
  margin: 9px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.token-tagline {
  margin: 0 auto;
  max-width: 580px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

/* CA + quick links */
.token-ca-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}
.token-ca-row code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  padding: 7px 12px;
  border-radius: 6px;
  word-break: break-all;
  max-width: 100%;
}
.token-pill {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms;
}
.token-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}
.token-pill.copied {
  color: #22c55e;
  border-color: #22c55e;
}

/* Stat cards */
.token-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.token-stats:empty { display: none; }
.token-stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
}
.token-stat .ts-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.token-stat .ts-value {
  margin-top: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.token-stat .ts-value.up   { color: #22c55e; }
.token-stat .ts-value.down { color: #ef4444; }

/* Chart */
.token-chart-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elev);
}
.token-chart-wrap iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
}
.token-msg {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  padding: 40px 24px;
}
.token-msg.error { color: #f87171; }

/* Actions */
.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.token-btn {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 6px;
  text-decoration: none;
  background: var(--accent);
  color: #0a0a0a;
}
.token-btn:hover { background: var(--accent-soft); text-decoration: none; }
.token-btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.token-btn.secondary:hover { background: rgba(245, 158, 11, 0.1); }

.token-disclaimer {
  text-align: center;
  margin: 18px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

/* ---- "Coming soon" placeholder state ------------------------- */
.token-chip.soon .token-chip-live {
  background: var(--accent);
  animation: none;
}
.token-chip.soon .token-chip-price {
  color: var(--text-dim);
}

.token-soon {
  text-align: center;
  padding: 46px 24px;
}
.token-soon-rocket {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 10px;
}
.token-soon-title {
  font-family: ui-monospace, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent);
}
.token-soon-text {
  margin: 8px auto 18px;
  max-width: 420px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .token-chart-wrap iframe { height: 420px; }
  .header-right { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .token-chip-live { animation: none; }
}
