/* === MAGNA — Dark/Orange Crypto Dashboard === */

:root {
  --bg-0: #08040a;
  --bg-1: #120708;
  --bg-2: #1c0a0c;
  --bg-3: #2a0e10;
  --border: #3a1416;
  --border-2: #4a1c1f;
  --text-0: #fff5ec;
  --text-1: #d6b8a8;
  --text-2: #8a6a5e;
  --orange-1: #ff3d00;
  --orange-2: #ff7a18;
  --orange-3: #ffb030;
  --red: #c81e1e;
  --accent: #ff7a18;
  --accent-glow: rgba(255, 122, 24, 0.45);
  --neon: #ff3d00;
  --neon-glow: rgba(255, 61, 0, 0.4);
  --up: #2dd17a;
  --down: #ff3a4a;
  --warning: #ffb030;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px rgba(255, 61, 0, 0.18);
}

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

html, body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 61, 0, 0.18), transparent 55%),
    radial-gradient(ellipse at 100% 30%, rgba(255, 122, 24, 0.10), transparent 60%),
    radial-gradient(ellipse at 0% 80%, rgba(200, 30, 30, 0.10), transparent 60%),
    var(--bg-0);
}

/* Animated canvas background sits behind everything */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.nav, main, footer {
  position: relative;
  z-index: 2;
}

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

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

/* === Navbar === */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 4, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
  font-family: 'Inter', serif;
  text-transform: uppercase;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, #000 0%, #1a0a08 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 24px var(--neon-glow), inset 0 0 0 1px var(--border-2);
}

.logo-mark svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 4px var(--orange-2));
}

.logo-text {
  background: linear-gradient(90deg, #fff 0%, var(--orange-3) 50%, var(--orange-1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav-links a {
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-0);
  background: var(--bg-2);
}

.nav-spacer {
  flex: 1;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  width: 240px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus-within {
  border-color: var(--orange-2);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text-0);
  font-size: 13px;
  width: 100%;
}

.search input::placeholder {
  color: var(--text-2);
}

.search-icon {
  color: var(--text-2);
  margin-right: 8px;
  font-size: 14px;
}

/* Mobile menu toggle */
.menu-btn {
  display: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* === Container === */

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 18px;
}

/* === Hero === */

.hero {
  padding: 28px 0 16px;
}

.hero h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.15;
}

.hero h1 .accent {
  background: linear-gradient(90deg, var(--orange-3), var(--orange-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-1);
  font-size: 14px;
  max-width: 640px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(28, 10, 12, 0.85), rgba(18, 7, 8, 0.85));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--orange-2), transparent);
  opacity: 0.6;
}

.stat-label {
  color: var(--text-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  color: var(--text-0);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
}

/* === Table === */

.table-wrap {
  margin-top: 18px;
  background: rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(8px);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.toolbar-spacer {
  flex: 1;
}

.btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  color: var(--text-0);
  border-color: var(--orange-2);
}

.btn.active {
  background: linear-gradient(135deg, var(--orange-1), var(--orange-2));
  color: #fff;
  border-color: var(--orange-1);
  box-shadow: 0 0 18px var(--neon-glow);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

thead th {
  text-align: right;
  padding: 12px 14px;
  background: rgba(28, 10, 12, 0.95);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: var(--text-0);
}

thead th.sort-asc::after { content: " ↑"; color: var(--orange-2); }
thead th.sort-desc::after { content: " ↓"; color: var(--orange-2); }

thead th:first-child,
thead th.left {
  text-align: left;
}

tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.12s;
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(255, 122, 24, 0.06);
}

td.left {
  text-align: left;
}

.coin-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.coin-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.coin-name {
  font-weight: 700;
  color: var(--text-0);
}

.coin-symbol {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
}

.rank-pill {
  display: inline-block;
  background: var(--bg-3);
  color: var(--text-1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
}

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

.spark {
  width: 130px;
  height: 40px;
  display: inline-block;
}

/* === Loader / States === */

.loader {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-2);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--orange-2);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.error {
  padding: 28px 20px;
  text-align: center;
  color: var(--down);
  background: rgba(255, 58, 74, 0.08);
  border: 1px solid rgba(255, 58, 74, 0.3);
  border-radius: 12px;
  margin: 14px;
}

/* === Coin detail page === */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 18px;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--orange-2);
}

.coin-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.coin-header img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(255, 122, 24, 0.3);
}

.coin-header-meta h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coin-header-meta .symbol-pill {
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
}

.coin-header-meta .rank-pill {
  font-size: 12px;
  padding: 3px 10px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.price-line .price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-line .change {
  font-size: 16px;
  font-weight: 700;
}

.coin-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

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

.chart-card,
.info-card {
  background: rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.chart-card h3,
.info-card h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.range-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.range-tabs .btn {
  padding: 6px 11px;
  font-size: 11px;
}

.chart-canvas-wrap {
  position: relative;
  height: 360px;
}

.info-list {
  display: flex;
  flex-direction: column;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row .k {
  color: var(--text-2);
  flex-shrink: 0;
}

.info-row .v {
  color: var(--text-0);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-word;
}

.about-card {
  margin-top: 20px;
  background: rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.about-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.about-card .desc {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.7;
  max-height: 260px;
  overflow-y: auto;
}

.about-card .desc a {
  color: var(--orange-2);
  text-decoration: underline;
}

/* === Footer === */

footer {
  margin: 40px 0 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 12px;
  padding: 0 18px;
}

footer a {
  color: var(--text-1);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* === Responsive: tablet === */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }
}

/* === Responsive: mobile === */
@media (max-width: 720px) {
  .nav-inner { padding: 10px 14px; gap: 10px; }
  .logo { font-size: 17px; }
  .logo-mark { width: 30px; height: 30px; }
  .logo-mark svg { width: 20px; height: 20px; }
  .menu-btn { display: flex; }
  .search { width: 100%; max-width: none; }
  .container { padding: 16px 14px; }
  .hero { padding: 18px 0 10px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; }
  .stat-value { font-size: 15px; }
  .table-wrap { border-radius: 12px; }
  .table-toolbar { padding: 12px; }
  .table-toolbar h2 { font-size: 14px; flex-basis: 100%; }
  thead th, tbody td { padding: 10px 8px; font-size: 12px; }
  .coin-cell { min-width: 140px; gap: 8px; }
  .coin-name { font-size: 13px; }
  .spark { width: 80px; height: 30px; }
  .price-line .price { font-size: 24px; }
  .coin-header img { width: 48px; height: 48px; }
  .coin-header-meta h1 { font-size: 22px; }
  .chart-card, .info-card, .about-card { padding: 14px; }
  .chart-canvas-wrap { height: 280px; }
}

/* Mobile drawer for nav */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(8, 4, 10, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px;
  z-index: 49;
}

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

.mobile-drawer a {
  display: block;
  padding: 12px 14px;
  color: var(--text-1);
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
}

.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: var(--bg-2);
  color: var(--text-0);
}

/* Search bar shifts to its own row on mobile */
@media (max-width: 720px) {
  .search { order: 5; flex-basis: 100%; margin-top: 8px; }
}

/* === Buy Coin CTA + X social icon === */

.buy-coin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #2dd17a, #21a05f);
  color: #04140b;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  text-decoration: none;
  box-shadow: 0 0 22px rgba(45, 209, 122, 0.3), inset 0 0 0 1px rgba(255,255,255,0.18);
}

.buy-coin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(45, 209, 122, 0.5), inset 0 0 0 1px rgba(255,255,255,0.3);
  color: #04140b;
}

.buy-coin-btn .buy-coin-icon {
  font-size: 14px;
  line-height: 1;
}

.x-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.15s;
}

.x-icon-btn:hover {
  color: var(--text-0);
  border-color: var(--orange-2);
  background: var(--bg-3);
}

@media (max-width: 1024px) {
  .buy-coin-btn { display: none; }
  .x-icon-btn { display: none; }
}

.drawer-external {
  display: flex !important;
  align-items: center;
  padding: 12px 14px !important;
  border-radius: 8px;
  font-weight: 600 !important;
  margin-top: 6px;
}

.drawer-external:first-of-type {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 18px !important;
}

/* MEME nav link with playful gradient */
.nav-link-meme {
  position: relative;
  background: linear-gradient(90deg, #ff3d00, #ffb030, #14F195, #9945FF, #ff3d00);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  animation: meme-shift 6s linear infinite;
}

.nav-link-meme.active {
  background-size: 300% 100%;
  animation-duration: 3s;
}

@keyframes meme-shift {
  to { background-position: 300% 0; }
}

/* === Wallet button === */

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--orange-1), var(--orange-2));
  color: #fff;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  box-shadow: 0 0 22px var(--neon-glow), inset 0 0 0 1px rgba(255,255,255,0.12);
}

.wallet-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px var(--neon-glow), inset 0 0 0 1px rgba(255,255,255,0.2);
}

.wallet-btn.connected {
  background: linear-gradient(135deg, #1a0a08, #2a0e10);
  border: 1px solid var(--border-2);
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.18);
}

.wallet-btn .wallet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
}

.wallet-btn.connected .wallet-dot {
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}

@media (max-width: 720px) {
  .wallet-btn { display: none; }
  .wallet-btn--mobile { display: inline-flex !important; }
}

@media (min-width: 721px) {
  .wallet-btn--mobile { display: none !important; }
}

/* === Modal === */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

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

.modal {
  background: linear-gradient(180deg, #1a0a0c, #120708);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 28px 24px 22px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 60px rgba(255, 61, 0, 0.12);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-0); background: var(--bg-3); }

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.modal-sub {
  color: var(--text-1);
  font-size: 13px;
  margin-bottom: 18px;
}

.modal-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  text-align: center;
}

.modal-foot a {
  color: var(--orange-2);
  text-decoration: underline;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.modal-actions .btn {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  font-size: 13px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-danger {
  background: rgba(255, 58, 74, 0.12);
  color: var(--down);
  border-color: rgba(255, 58, 74, 0.4);
}

.btn-danger:hover {
  background: rgba(255, 58, 74, 0.2);
  border-color: var(--down);
  color: var(--down);
}

/* === Wallet options inside modal === */

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text-0);
  transition: all 0.15s;
  font-family: inherit;
}

.wallet-option:hover:not(:disabled) {
  background: var(--bg-3);
  border-color: var(--orange-2);
  transform: translateX(2px);
}

.wallet-option:disabled { opacity: 0.6; cursor: wait; }

.wallet-option-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.wallet-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-option-text strong {
  font-size: 14px;
  font-weight: 700;
}

.wallet-option-text small {
  font-size: 11px;
  color: var(--text-2);
}

.wallet-option-arrow {
  color: var(--text-2);
  font-size: 18px;
}

/* === Portfolio === */

.portfolio-hero {
  background:
    linear-gradient(135deg, rgba(255, 61, 0, 0.18), rgba(255, 122, 24, 0.04) 60%, transparent),
    rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

.portfolio-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.18), transparent 60%);
  pointer-events: none;
}

.portfolio-hero h1 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.portfolio-total {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.portfolio-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-1);
}

.portfolio-meta .chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 12px;
}

.portfolio-meta .addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  word-break: break-all;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-1), var(--orange-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  box-shadow: 0 0 50px var(--accent-glow);
}

.empty-state h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-1);
  margin-bottom: 18px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state .wallet-btn {
  display: inline-flex !important;
  font-size: 14px;
  padding: 12px 22px;
}

/* === Token cards on portfolio === */

.token-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.token-row-icon.native {
  background: linear-gradient(135deg, #ffb030, #ff3d00);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* === Exchange / NFT cards === */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.card {
  background: rgba(18, 7, 8, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.15s;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: var(--orange-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 61, 0, 0.18);
}

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

.card-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  flex-shrink: 0;
  object-fit: cover;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 12px;
  color: var(--text-2);
}

.card-rank {
  background: var(--bg-3);
  color: var(--orange-2);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  margin-left: auto;
}

.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.card-stat-label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-stat-value {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* === Star (watchlist) === */

.star-btn {
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}

.star-btn:hover {
  color: var(--orange-2);
  transform: scale(1.15);
}

.star-btn.active {
  color: var(--orange-3);
  filter: drop-shadow(0 0 4px var(--orange-2));
}

/* === Page hero (used on Portfolio, Exchanges, NFTs) === */

.page-hero {
  padding: 28px 0 8px;
}

.page-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-hero p {
  color: var(--text-1);
  font-size: 14px;
  max-width: 640px;
}

/* === Mobile tweaks for portfolio === */
@media (max-width: 720px) {
  .portfolio-total { font-size: 32px; }
  .portfolio-hero { padding: 20px 16px; }
  .modal { padding: 22px 16px; }
  .page-hero h1 { font-size: 22px; }
  .card-grid { grid-template-columns: 1fr; }
}
