:root {
  --bg-main: #050712;
  --bg-card: #0b0f1e;
  --bg-card-alt: #090c18;
  --accent-gold: #f6c25a;
  --accent-gold-soft: #e6b14a;
  --accent-blue: #39a0ff;
  --accent-purple: #7e5dff;
  --danger: #ff3b5c;
  --mid: #ffc94a;
  --safe: #21d07a;
  --text-main: #f8fbff;
  --text-muted: #8c94b0;
  --border-soft: rgba(255, 255, 255, 0.07);
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.6);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --transition-fast: 0.18s ease-out;
}

body[data-theme="light"] {
  --bg-main: #f3f5ff;
  --bg-card: #ffffff;
  --bg-card-alt: #f6f7ff;
  --text-main: #050712;
  --text-muted: #5c6282;
  --border-soft: rgba(10, 14, 40, 0.08);
}

/* Global */

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background: radial-gradient(circle at top, #111633 0, #050712 55%);
  color: var(--text-main);
  min-height: 100vh;
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 18px 32px;
}

/* Header */

.xr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.xr-logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xr-logo-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #3be4ff, #12254a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 180, 255, 0.6);
}

.xr-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.xr-logo-text .xr-brand {
  font-size: 20px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.xr-logo-text .xr-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.xr-header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xr-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */

.pill-toggle {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 18px;
  background: linear-gradient(90deg, #15182d, #1c2341);
  color: var(--accent-blue);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pill-toggle-active {
  box-shadow: 0 0 16px rgba(0, 192, 255, 0.8);
}

.pill-toggle-small {
  padding: 6px 14px;
  font-size: 10px;
}

.pill-toggle-knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-gold), #ff6f48);
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-main);
  padding: 6px 10px;
  cursor: pointer;
}

.wallet-btn {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  background: linear-gradient(90deg, #2c7cff, #7e5dff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.wallet-btn.wallet-connected {
  background: linear-gradient(90deg, #21d07a, #2bd3ff);
}

/* Layout */

.xr-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr);
  gap: 18px;
}

.xr-left,
.xr-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hero */

.hero-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  background: radial-gradient(circle at top left, #252e5b, #090c18 55%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  border: 1px solid rgba(173, 195, 255, 0.1);
}

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

.hero-image {
  max-width: 100%;
  border-radius: 20px;
}

.hero-copy h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.hero-sub {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.hero-bullets {
  padding-left: 18px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.primary-btn {
  border-radius: 999px;
  border: none;
  padding: 10px 20px;
  background: linear-gradient(90deg, var(--accent-gold), #ff7f4b);
  color: #050712;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* Scanner Card */

.scanner-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}

.scanner-header-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.scanner-title {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold-soft);
}

.scanner-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.scanner-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.meta-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-size: 10px;
}

.meta-value {
  font-size: 11px;
}

.meta-ok {
  color: var(--safe);
}

.meta-warn {
  color: var(--mid);
}

.meta-bad {
  color: var(--danger);
}

/* Scan form */

.scan-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 130px 110px;
  gap: 8px;
  margin-bottom: 8px;
}

.scan-form input,
.scan-form select {
  background: var(--bg-card-alt);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
}

.scan-btn {
  font-weight: 600;
}

.scan-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Risk bar */

.scan-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.score-label {
  font-size: 11px;
}

.score-bar-wrap {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b222c, #111520);
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width var(--transition-fast);
  background: linear-gradient(90deg, #21d07a, #ffc94a, #ff3b5c);
}

.score-safe {
  background: linear-gradient(90deg, #21d07a, #39ffc7);
}

.score-mid {
  background: linear-gradient(90deg, #ffc94a, #ff9f4b);
}

.score-danger {
  background: linear-gradient(90deg, #ff7b5c, #ff3b5c);
}

/* Pills */

.risk-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  margin-left: 6px;
}

.risk-pill-neutral {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.risk-pill-safe {
  background: rgba(33, 208, 122, 0.1);
  color: var(--safe);
}

.risk-pill-mid {
  background: rgba(255, 201, 74, 0.12);
  color: var(--mid);
}

.risk-pill-danger {
  background: rgba(255, 59, 92, 0.12);
  color: var(--danger);
}

.signal-pill {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.signal-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.signal-entry {
  background: rgba(33, 208, 122, 0.15);
  color: var(--safe);
}

.signal-exit {
  background: rgba(255, 59, 92, 0.15);
  color: var(--danger);
}

/* Scan details */

.scan-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.scan-detail-col {
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-value {
  font-size: 13px;
}

.detail-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Scan actions */

.scan-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ghost-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text-main);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}

.scan-signal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.whale-info {
  font-size: 11px;
  color: var(--text-muted);
}

/* Watchlist */

.watchlist-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-header-row h2 {
  font-size: 14px;
  margin: 0;
}

.small-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Token list */

.token-list {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 2px;
}

.token-list-compact {
  max-height: 220px;
}

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
  background: rgba(16, 22, 44, 0.85);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.token-row:hover {
  background: rgba(25, 34, 68, 0.95);
  transform: translateY(-1px);
}

.token-row-compact {
  padding: 6px 6px;
  background: rgba(16, 22, 44, 0.7);
}

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

.token-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.token-name {
  font-weight: 500;
}

.token-symbol {
  font-size: 11px;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.token-sub-line {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
}

.token-addr {
  font-family: "SF Mono", Menlo, monospace;
}

.token-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.score-mini {
  width: 28px;
  height: 18px;
  border-radius: 999px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.score-mini-moon {
  background: rgba(33, 208, 122, 0.18);
  color: var(--safe);
}

.score-mini-rug {
  background: rgba(255, 59, 92, 0.2);
  color: var(--danger);
}

.token-meta-numbers {
  font-size: 10px;
  text-align: right;
  color: var(--text-muted);
}

.token-meta-numbers .vol {
  font-size: 10px;
}

.token-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-icon {
  font-size: 13px;
}

.signal-chip {
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 999px;
}

/* Badge */

.token-logo-badge {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2c7cff, #7e5dff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Radar */

.radar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 16px 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.radar-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}

.tab-btn-active {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border-color: transparent;
}

.radar-subheader {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.radar-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-pill {
  width: 12px;
  height: 6px;
  border-radius: 999px;
}

.legend-safe {
  background: var(--safe);
}

.legend-mid {
  background: var(--mid);
}

.legend-danger {
  background: var(--danger);
}

/* States */

.empty-state {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Footer */

.xr-footer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Responsive */

@media (max-width: 960px) {
  .xr-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .scan-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .scan-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .xr-header {
    flex-wrap: wrap;
    gap: 10px;
  }
}
