:root {
  --bg: #07080a;
  --surface: #0e1014;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #f4f5f7;
  --muted: rgba(244, 245, 247, 0.45);
  --accent: #d4ff3f;
  --accent-ink: #0a0b0d;
  --up: #3dff9a;
  --down: #ff5c6a;
  --radius: 0.75rem;
  --font-display: "Syne", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Syne", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--line);
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 255, 63, 0.12), transparent 55%),
    radial-gradient(ellipse 40% 40% at 100% 30%, rgba(60, 90, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #07080a 0%, #0a0c10 100%);
  background-attachment: fixed;
}

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

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

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

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.6;
  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.04'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  min-height: 100vh;
  color: var(--ink);
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-domain {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

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

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

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

.btn-accent {
  border-radius: 9999px;
  background: var(--accent);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-ink);
  transition: filter 0.15s ease;
}

.btn-accent:hover {
  filter: brightness(1.1);
}

/* Hero */
.hero {
  margin-bottom: 2rem;
  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(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.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.18em;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}

.hero-subtitle {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
  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.1);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

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

.stat-value {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  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.5rem;
  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.1);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

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

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

.timeframe-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Podium */
.podium-wrap {
  margin-bottom: 3rem;
  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;
  filter: drop-shadow(0 0 10px rgba(212, 255, 63, 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-display);
  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(255, 255, 255, 0.1);
  border-bottom: none;
  background: linear-gradient(to top, rgba(212, 255, 63, 0.12), 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-display);
  font-size: 1.875rem;
  font-weight: 800;
}

/* Table */
.table-wrap {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 14, 18, 0.8);
  backdrop-filter: blur(4px);
  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.1);
  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.06);
  transition: background 0.15s ease;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.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(255, 255, 255, 0.1);
}

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

.trader-name {
  font-family: var(--font-display);
  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: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
  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.25);
}

@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: 2.5rem 1.5rem 0; }
  .brand-name { font-size: 1.5rem; }
  .hero-title { font-size: 3.75rem; }
  .hero-subtitle { font-size: 1rem; }
  .stats { gap: 1rem; }
  .stat-card { padding: 1rem 1.25rem; }
  .stat-value { font-size: 1.5rem; }
  .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: 9rem; }
  .podium-bar.h-mid { height: 12rem; }
  .podium-bar.h-tall { height: 8rem; }
  .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) {
  .hero-title { font-size: 4.5rem; }
  .col-win { display: block; }
}

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