:root {
  --bg: #090b10;
  --bg-soft: #11151c;
  --bg-card: rgba(17, 21, 28, 0.72);
  --bg-elevated: rgba(22, 27, 36, 0.88);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f0f3f8;
  --text-soft: #c8d0dc;
  --muted: #8b95a8;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.22);
  --accent-2: #34d399;
  --accent-2-glow: rgba(52, 211, 153, 0.18);
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.18);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.42);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --max: 1200px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(52, 211, 153, 0.06), transparent),
    radial-gradient(ellipse 40% 30% at 0% 100%, rgba(99, 102, 241, 0.05), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max);
  width: 92%;
  margin: 0 auto;
}

/* ── Header / Nav ── */

.site-top {
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar {
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(9, 11, 16, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 4px 16px var(--accent-glow);
  font-size: 14px;
  color: #fff;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chain-badge i {
  font-size: 11px;
  opacity: 0.85;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn.primary:hover {
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
  border-color: transparent;
  background: linear-gradient(135deg, #4f8ff7, #3b82f6);
}

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

.btn.ghost:hover {
  color: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.06);
}

.btn.sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── Marquee ── */

.marquee-section {
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 49;
}

.marquee-bar {
  --marquee-height: 48px;
  display: flex;
  align-items: center;
  height: var(--marquee-height);
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.75);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.marquee-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--marquee-height);
  padding: 0 16px;
  border-right: 1px solid var(--border);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: rgba(251, 191, 36, 0.06);
  flex-shrink: 0;
}

.marquee-label i {
  font-size: 12px;
}

.marquee-track {
  overflow: hidden;
  flex: 1;
  position: relative;
  height: var(--marquee-height);
}

.marquee-track::before,
.marquee-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 2;
  pointer-events: none;
}

.marquee-track::before {
  left: 0;
  background: linear-gradient(90deg, rgba(9, 11, 16, 0.95), transparent);
}

.marquee-track::after {
  right: 0;
  background: linear-gradient(270deg, rgba(9, 11, 16, 0.95), transparent);
}

.marquee-content {
  display: flex;
  align-items: center;
  height: var(--marquee-height);
  width: max-content;
  animation: marquee-scroll 55s linear infinite;
  will-change: transform;
}

.marquee-content.is-reordering {
  animation-play-state: paused;
}

.marquee-item.is-flipping {
  position: relative;
  z-index: 3;
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.marquee-item.is-entering {
  opacity: 0;
  transform: scale(0.94);
  animation: market-fade-in 0.42s ease forwards;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--marquee-height);
  padding: 0 16px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.2s ease;
}

.marquee-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.marquee-logo {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}

.marquee-logo.fallback {
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-soft);
  font-size: 10px;
}

.marquee-name {
  font-weight: 600;
  font-size: 12px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-soft);
}

.marquee-symbol {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.marquee-stat {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
}

.marquee-stat i {
  color: var(--muted);
  font-size: 9px;
  opacity: 0.7;
}

.marquee-stat .count-value {
  color: var(--text-soft);
  font-weight: 600;
}

/* ── Hero ── */

.hero {
  padding: 48px 0 32px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 32px;
}

.hero-copy {
  max-width: 640px;
}

.pill {
  width: fit-content;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2-glow);
  flex-shrink: 0;
}

h1 {
  font-size: clamp(32px, 5.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin-bottom: 16px;
  font-weight: 800;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #93c5fd 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
  max-width: 520px;
  line-height: 1.65;
  font-weight: 400;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.06);
  white-space: nowrap;
  flex-shrink: 0;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: live-pulse 2s ease infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.live-badge-text {
  display: grid;
  gap: 1px;
}

.live-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

#liveClock {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.data-age {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.data-age.is-fresh {
  color: var(--accent-2);
}

.data-age.is-stale {
  color: #fbbf24;
}

/* ── Stats ── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.stat:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: var(--accent-soft);
  font-size: 15px;
  flex-shrink: 0;
}

.stat:nth-child(2) .stat-icon {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.18);
  color: var(--accent-2);
}

.stat:nth-child(3) .stat-icon {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.stat-body {
  min-width: 0;
}

.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── Sections ── */

section {
  padding: 48px 0;
}

.tokens-section {
  padding-top: 8px;
}

.section-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
  margin-bottom: 10px;
}

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

.section-title {
  max-width: 640px;
  margin: 0;
  text-align: left;
}

.section-title h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  letter-spacing: -0.035em;
  margin-bottom: 8px;
  font-weight: 700;
}

.section-title p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.feed-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.feed-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.feed-tab i {
  font-size: 11px;
  opacity: 0.75;
}

.feed-tab:hover {
  color: var(--text-soft);
}

.feed-tab.active {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.feed-tab.active i {
  opacity: 1;
  color: var(--accent-soft);
}

/* ── Token Table ── */

.token-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease;
}

.token-table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.token-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.token-table th,
.token-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.token-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  z-index: 1;
}

.token-table tbody tr {
  transition: background 0.15s ease, transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.token-table tbody tr:last-child td {
  border-bottom: none;
}

.token-table tbody tr.is-flipping {
  position: relative;
  z-index: 2;
}

.token-table tbody tr.is-entering {
  opacity: 0;
  transform: translateY(12px);
  animation: market-fade-in 0.42s ease forwards;
}

.token-table tbody tr.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.token-table .rank {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  width: 48px;
  transition: color 0.3s ease;
}

.token-table .rank.rank-top {
  color: var(--muted);
}

.token-table .rank.rank-top-1 {
  animation: rank-neon-gold 2.2s ease-in-out infinite;
}

.token-table .rank.rank-top-2 {
  animation: rank-neon-silver 2.4s ease-in-out infinite;
}

.token-table .rank.rank-top-3 {
  animation: rank-neon-bronze 2.6s ease-in-out infinite;
}

@keyframes rank-neon-gold {
  0%, 100% {
    text-shadow:
      0 0 3px rgba(251, 191, 36, 0.25),
      0 0 6px rgba(251, 191, 36, 0.15);
  }
  50% {
    text-shadow:
      0 0 6px rgba(251, 191, 36, 0.55),
      0 0 14px rgba(251, 191, 36, 0.35),
      0 0 22px rgba(251, 191, 36, 0.18);
  }
}

@keyframes rank-neon-silver {
  0%, 100% {
    text-shadow:
      0 0 3px rgba(148, 163, 184, 0.25),
      0 0 6px rgba(148, 163, 184, 0.15);
  }
  50% {
    text-shadow:
      0 0 6px rgba(148, 163, 184, 0.55),
      0 0 14px rgba(186, 198, 214, 0.35),
      0 0 22px rgba(148, 163, 184, 0.18);
  }
}

@keyframes rank-neon-bronze {
  0%, 100% {
    text-shadow:
      0 0 3px rgba(217, 119, 6, 0.25),
      0 0 6px rgba(217, 119, 6, 0.15);
  }
  50% {
    text-shadow:
      0 0 6px rgba(217, 119, 6, 0.55),
      0 0 14px rgba(245, 158, 11, 0.35),
      0 0 22px rgba(217, 119, 6, 0.18);
  }
}

.token-table .rank.rank-shift-up {
  color: var(--accent-2);
}

.token-table .rank.rank-shift-down {
  color: var(--danger);
}

.count-value {
  display: inline-block;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.count-value.count-trend-up,
.count-value.count-flash-up {
  color: var(--accent-2);
}

.count-value.count-trend-down,
.count-value.count-flash-down {
  color: var(--danger);
}

.cell-change .count-value.count-trend-up,
.cell-change .count-value.count-flash-up {
  color: var(--accent-2);
}

.cell-change .count-value.count-trend-down,
.cell-change .count-value.count-flash-down {
  color: var(--danger);
}

@keyframes market-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.token-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.token-cell {
  min-width: 220px;
}

.token-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.15s ease;
}

.token-link:hover {
  opacity: 0.85;
}

.token-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}

.token-logo.fallback {
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-soft);
  font-size: 13px;
}

.token-meta {
  display: grid;
  gap: 2px;
}

.token-meta strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.token-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.mono.highlight {
  color: var(--accent-soft);
  font-weight: 600;
}

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

.change.up {
  color: var(--accent-2);
}

.change.down {
  color: var(--danger);
}

.change.neutral {
  color: var(--muted);
}

.cell-change.up .count-value,
.cell-change.down .count-value {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.cell-change.up .count-value {
  background: rgba(52, 211, 153, 0.08);
}

.cell-change.down .count-value {
  background: rgba(248, 113, 113, 0.08);
}

.action {
  width: 48px;
}

/* ── Empty State ── */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--accent-soft);
  font-size: 20px;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 14px;
}

/* ── Info Cards ── */

.info-section {
  padding-top: 16px;
  padding-bottom: 64px;
}

.info-header {
  margin-bottom: 28px;
}

.info-header h2 {
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--accent-soft);
}

.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  background: rgba(9, 11, 16, 0.5);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-soft);
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 11px;
}

.footer-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ── Error Page ── */

.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 0;
}

.error-page h1 {
  font-size: clamp(48px, 10vw, 96px);
  margin-bottom: 12px;
}

.error-page p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── Token Modal ── */

.token-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.token-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.token-modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.token-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.token-modal.is-open .token-modal-backdrop {
  opacity: 1;
}

.token-modal-panel {
  position: relative;
  width: 100%;
  max-width: 1140px;
  height: min(84vh, 920px);
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.28s ease;
}

.token-modal.is-open .token-modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.token-modal.is-closing .token-modal-panel {
  transform: scale(0.96) translateY(48px);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.8, 0.2),
    opacity 0.28s ease;
}

.token-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.token-modal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.token-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
  flex-shrink: 0;
}

.token-modal-badge.is-bankr {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
}

.token-modal-title-wrap {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.token-modal-title-wrap strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.token-modal-title-wrap span {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.token-modal-close {
  width: 36px;
  padding-inline: 0;
}

.token-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #0a0d12;
}

.token-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.token-modal-body.is-loaded iframe {
  opacity: 1;
}

.token-modal-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 16px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(59, 130, 246, 0.06), transparent 55%),
    rgba(10, 13, 18, 0.96);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.token-modal-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.token-modal-loader p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.loader-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto;
}

.loader-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: loader-spin 1.1s linear infinite;
}

.loader-orbit span:nth-child(1) {
  border-top-color: var(--accent);
  animation-delay: 0s;
}

.loader-orbit span:nth-child(2) {
  inset: 7px;
  border-right-color: var(--accent-2);
  animation-delay: -0.25s;
  animation-direction: reverse;
}

.loader-orbit span:nth-child(3) {
  inset: 14px;
  border-bottom-color: #818cf8;
  animation-delay: -0.5s;
}

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

.token-open-btn {
  cursor: pointer;
}

.is-refreshing i {
  animation: spin 0.8s linear infinite;
}

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

/* ── Responsive ── */

@media (max-width: 900px) {
  .hero-top {
    flex-direction: column;
    gap: 20px;
  }

  .live-badge {
    align-self: flex-start;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .feed-tabs {
    width: 100%;
    justify-content: center;
  }

  .marquee-label span {
    display: none;
  }
}

@media (max-width: 620px) {
  .container {
    width: 90%;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }

  .marquee-name {
    max-width: 72px;
  }

  .marquee-stat:last-child {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .token-modal {
    padding: 12px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .token-modal-panel {
    width: 100%;
    max-width: none;
    height: min(90vh, 100%);
    border-radius: var(--radius);
  }

  .token-modal-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }

  .token-modal-brand {
    flex: 1 1 100%;
    min-width: 0;
    order: 1;
  }

  .token-modal-actions {
    flex: 1 1 100%;
    order: 2;
    justify-content: flex-end;
  }

  .token-modal-badge {
    min-width: auto;
    flex-shrink: 0;
  }

  .token-modal-link .link-label {
    display: none;
  }
}
