:root {
  --background: #0a0a0f;
  --bg: #0a0a0f;
  --surface: #0d0a17;
  --surface-2: #161226;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #ffffff;
  --muted: #9893b8;
  --accent: #8b5cf6;
  --accent-bright: #a41cff;
  --accent-soft: #e496ff;
  --accent-glow: rgba(139, 92, 246, 0.45);
  --accent-ink: #ffffff;
  --up: #22c55e;
  --down: #ef4444;
  --radius: 0.75rem;
  --font-heading: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.28), transparent 55%),
    radial-gradient(ellipse 40% 35% at 100% 20%, rgba(164, 28, 255, 0.14), transparent 50%),
    linear-gradient(180deg, #0a0a0f 0%, #0d0a17 100%);
  background-attachment: fixed;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

.font-display { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.35;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* Ticker */
.ticker-blur {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(13, 10, 23, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.625rem 0;
}

.ticker-fade-l,
.ticker-fade-r {
  pointer-events: none;
  position: absolute;
  inset-block: 0;
  width: 6rem;
  z-index: 10;
}

.ticker-fade-l {
  left: 0;
  background: linear-gradient(to right, var(--background), transparent);
}

.ticker-fade-r {
  right: 0;
  background: linear-gradient(to left, var(--background), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 55s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  flex-shrink: 0;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0 1.5rem;
}

.ticker-sym {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.ticker-price {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.ticker-chg {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.ticker-chg.up { color: rgb(34, 197, 94); }
.ticker-chg.down { color: rgb(239, 68, 68); }

.ticker-dot {
  color: rgba(255, 255, 255, 0.1);
}

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

.container {
  position: relative;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: fade-in 0.6s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 1.75rem;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.15);
}

.brand-product {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
}

.brand-product span {
  color: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ghost {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  border-radius: 9999px;
  background: linear-gradient(135deg, #8b5cf6, #a41cff);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-accent:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 32px rgba(164, 28, 255, 0.45);
}

/* Hero */
.hero {
  margin-bottom: 1.75rem;
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.1);
}

.live-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--up);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.live-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-soft);
}

.hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(100deg, #ffffff 20%, #e496ff 55%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0.85rem auto 0;
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.stat-card {
  padding: 1rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 18, 38, 0.7);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.12), transparent 70%);
  pointer-events: none;
}

.stat-label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.stat-value {
  position: relative;
  margin-top: 0.3rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.stat-value.up { color: var(--up); }
.stat-value.down { color: var(--down); }

/* Timeframe */
.timeframe-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2.25rem;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}

.timeframe-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 10, 23, 0.7);
  backdrop-filter: blur(8px);
}

.timeframe-tab {
  border-radius: 9999px;
  padding: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
  transition: all 0.15s ease;
}

.timeframe-tab:hover { color: white; }

.timeframe-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #a41cff);
  color: white;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.4);
}

/* Podium */
.podium-wrap {
  margin-bottom: 2.5rem;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 240ms both;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33.333%;
  max-width: 200px;
}

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.podium-crown {
  position: absolute;
  top: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.75rem;
  height: 1.75rem;
  color: #e496ff;
  filter: drop-shadow(0 0 10px rgba(228, 150, 255, 0.55));
}

.podium-avatar {
  overflow: hidden;
  border-radius: 9999px;
  border: 2px solid;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
}

.podium-avatar.first { width: 4rem; height: 4rem; }
.podium-avatar.other { width: 3rem; height: 3rem; }

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-name {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.podium-pnl {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
}

.podium-pnl.up { color: var(--up); }
.podium-pnl.down { color: var(--down); }

.podium-bar {
  margin-top: 0.75rem;
  width: 100%;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-bottom: none;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.22), rgba(255, 255, 255, 0.02));
}

.podium-bar.h-short { height: 6rem; }
.podium-bar.h-mid { height: 7rem; }
.podium-bar.h-tall { height: 10rem; }

.podium-rank {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.75rem;
  height: 100%;
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 800;
}

/* Table */
.table-wrap {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 10, 23, 0.75);
  backdrop-filter: blur(8px);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 300ms both;
}

.table-header,
.table-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.table-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.table-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.table-row:last-child { border-bottom: none; }
.table-row:hover { background: rgba(139, 92, 246, 0.06); }

.col-rank { width: 1.5rem; flex-shrink: 0; text-align: center; }
.col-avatar { width: 2.25rem; flex-shrink: 0; }
.col-trader { flex: 1; min-width: 0; }
.col-roi,
.col-win,
.col-vol,
.col-pnl { text-align: right; }
.col-action { width: 5rem; margin-left: 0.25rem; flex-shrink: 0; }

.col-roi,
.col-win,
.col-vol { display: none; }

.row-rank {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
}

.avatar-wrap { position: relative; }

.avatar-wrap img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.avatar-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  border: 2px solid #0d0a17;
  background: var(--up);
}

.trader-name {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trader-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.3);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
}

.metric-value.up { color: var(--up); }
.metric-value.down { color: var(--down); }
.metric-value.neutral { color: rgba(255, 255, 255, 0.8); }

.btn-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #8b5cf6, #a41cff);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  transition: filter 0.15s ease;
}

.btn-follow:hover { filter: brightness(1.1); }
.btn-follow svg { width: 0.875rem; height: 0.875rem; }

.footer {
  margin-top: 2.5rem;
  padding-bottom: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.025em;
  color: rgba(255, 255, 255, 0.28);
}

.footer a {
  color: var(--accent-soft);
  text-decoration: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 4, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 420px;
  border-radius: 1.25rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background:
    radial-gradient(ellipse at top, rgba(139, 92, 246, 0.22), transparent 55%),
    #161226;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(139, 92, 246, 0.2);
  padding: 1.5rem;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.modal-close:hover { color: rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.06); }

.modal {
  position: relative;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 0.9rem;
}

.modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.modal-desc {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.modal-stat {
  padding: 0.75rem 0.4rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 15, 0.45);
  text-align: center;
}

.modal-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-stat-value {
  margin-top: 0.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-actions .btn-accent,
.modal-actions .btn-ghost {
  width: 100%;
  justify-content: center;
  padding: 0.8rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-note {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

@media (min-width: 640px) {
  .container { padding: 1.75rem 1.5rem 0; }
  .brand-logo { height: 2rem; }
  .brand-product { font-size: 1.05rem; }
  .stats { gap: 1rem; }
  .stat-card { padding: 1rem 1.25rem; }
  .stat-value { font-size: 1.4rem; }
  .timeframe-tab { font-size: 0.875rem; }
  .podium { gap: 1.5rem; }
  .podium-avatar.first { width: 5rem; height: 5rem; }
  .podium-avatar.other { width: 4rem; height: 4rem; }
  .podium-pnl { font-size: 1rem; }
  .podium-bar.h-short { height: 8rem; }
  .podium-bar.h-mid { height: 11rem; }
  .podium-bar.h-tall { height: 14rem; }
  .table-header,
  .table-row { gap: 1rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .col-rank { width: 2rem; }
  .col-avatar { width: 2.75rem; }
  .avatar-wrap img { width: 2.75rem; height: 2.75rem; }
  .trader-name { font-size: 1rem; }
  .col-roi { display: block; }
  .btn-follow { height: 2.25rem; padding: 0 1rem; }
}

@media (min-width: 768px) {
  .col-win { display: block; }
}

@media (min-width: 1024px) {
  .col-vol { display: block; }
}
