:root {
  --bg-base: #121316;
  --bg-surface: #18191D;
  --bg-elevated: #1F2126;
  --bg-hover: #25282F;
  --border: #2B2E36;
  --border-bright: #3E424D;
  --text-main: #ECEEF2;
  --text-muted: #989DA8;
  --text-dim: #686D78;
  --gold: #C8A45D;
  --gold-light: #E4C788;
  --gold-bg: rgba(200, 164, 93, 0.10);
  --silver: #9CA3AF;
  --silver-light: #D1D5DB;
  --bronze: #B87A56;
  --cyan: #C8A45D;
  --cyan-bg: rgba(200, 164, 93, 0.10);
  --blue: #8E95A2;
  --emerald: #5BA882;
  --emerald-bg: rgba(91, 168, 130, 0.12);
  --rose: #C96A76;
  --rose-bg: rgba(201, 106, 118, 0.12);
  --amber: #C8A45D;
  --amber-bg: rgba(200, 164, 93, 0.12);
  --purple: #9E8EB8;
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sticky-header-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 90;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.ticker-wrap {
  background: #0E0F12;
  border-bottom: 1px solid var(--border);
  height: 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
}

.ticker-badge {
  background: #1A1B20;
  color: var(--gold-light);
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.9px;
  flex-shrink: 0;
  z-index: 2;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  padding-left: 16px;
}

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

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 34px;
  cursor: pointer;
}

.ticker-item strong { color: var(--text-main); font-weight: 500; }
.ticker-up { color: var(--emerald); font-weight: 500; }
.ticker-price { color: var(--gold-light); font-weight: 500; }

.topbar {
  background: rgba(20, 21, 25, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

@media (max-width: 820px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand-subtitle { display: none; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.badge-live {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-bright);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-switcher {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover { color: var(--text-main); }
.lang-btn.active {
  background: var(--bg-elevated);
  border-color: var(--silver);
  color: var(--text-main);
}

.btn {
  padding: 7px 13px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1px solid #4A4E59;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--silver-light);
}

.btn-cyan {
  background: var(--bg-surface);
  color: var(--gold-light);
  border: 1px solid var(--gold);
}
.btn-cyan:hover {
  background: rgba(200, 164, 93, 0.10);
  border-color: var(--gold-light);
}

.container {
  max-width: 1460px;
  margin: 0 auto;
  padding: 110px 24px 60px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 18px;
  position: relative;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-main);
}

.stat-sub { font-size: 11px; color: var(--emerald); font-weight: 400; }

.spotlight-section { margin-bottom: 18px; }
.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.spotlight-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}
.spot-card {
  background: linear-gradient(90deg, rgba(200, 164, 93, 0.10) 0%, var(--bg-surface) 55%);
  border: 1px solid rgba(200, 164, 93, 0.42);
  border-radius: 10px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.spot-card:hover { border-color: var(--gold-light); background: var(--bg-elevated); }

/* ATTACHED FOLDER TABS: LEAGUES + FILTER BAR (Z-INDEX ABOVE TABLE DOCK) */
.filter-dock {
  position: relative;
  z-index: 30;
  margin-bottom: 16px;
}

.attached-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}
.attached-tabs::-webkit-scrollbar { display: none; }

.league-pill {
  background: #131418;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-muted);
  padding: 8px 15px 9px;
  border-radius: 9px 9px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.league-pill:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}
.league-pill.active {
  background: var(--bg-surface);
  border-color: var(--border-bright);
  color: var(--gold-light);
  font-weight: 500;
  box-shadow: 0 2px 0 0 var(--bg-surface);
}

.filter-bar {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: 0 10px 10px 10px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 40;
}
.input-dark, .select-dark {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-sans);
  position: relative;
  z-index: 45;
}
.input-dark:focus, .select-dark:focus {
  outline: none;
  border-color: var(--gold);
  z-index: 50;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-pill input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; }

/* ATTACHED FOLDER TABS: PLATFORMS + LEADERBOARD TABLE */
.table-dock {
  position: relative;
  z-index: 10;
}

.attached-platform-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}
.attached-platform-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1 0 auto;
  justify-content: center;
  background: #131418;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-muted);
  padding: 9px 13px 10px;
  border-radius: 9px 9px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}
.tab-btn.active {
  background: #141519;
  border-color: var(--border-bright);
  color: var(--gold-light);
  font-weight: 500;
  box-shadow: 0 2px 0 0 #141519;
}

.table-wrap {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: 0 0 10px 10px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
@media (max-width: 820px) {
  th, td { padding: 10px 8px; font-size: 12px; }
}

th {
  background: #141519;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  font-weight: 400;
}

tr.creator-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
tr.creator-row:hover { background: var(--bg-hover); }

/* TOP-3 METALLIC GRADIENT ROWS (50% fade into matte gray) */
tr.creator-row.row-gold {
  background: linear-gradient(90deg, rgba(200, 164, 93, 0.22) 0%, rgba(200, 164, 93, 0.06) 35%, var(--bg-surface) 54%);
}
tr.creator-row.row-gold td:first-child {
  border-left: 2px solid var(--gold);
}
tr.creator-row.row-gold:hover {
  background: linear-gradient(90deg, rgba(200, 164, 93, 0.28) 0%, rgba(200, 164, 93, 0.09) 38%, var(--bg-hover) 58%);
}

tr.creator-row.row-silver {
  background: linear-gradient(90deg, rgba(185, 192, 204, 0.19) 0%, rgba(185, 192, 204, 0.05) 35%, var(--bg-surface) 54%);
}
tr.creator-row.row-silver td:first-child {
  border-left: 2px solid var(--silver-light);
}
tr.creator-row.row-silver:hover {
  background: linear-gradient(90deg, rgba(185, 192, 204, 0.25) 0%, rgba(185, 192, 204, 0.08) 38%, var(--bg-hover) 58%);
}

tr.creator-row.row-bronze {
  background: linear-gradient(90deg, rgba(184, 122, 86, 0.20) 0%, rgba(184, 122, 86, 0.05) 35%, var(--bg-surface) 54%);
}
tr.creator-row.row-bronze td:first-child {
  border-left: 2px solid var(--bronze);
}
tr.creator-row.row-bronze:hover {
  background: linear-gradient(90deg, rgba(184, 122, 86, 0.26) 0%, rgba(184, 122, 86, 0.08) 38%, var(--bg-hover) 58%);
}

.rank-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.rank-1 { color: var(--gold-light); font-weight: 700; }
.rank-2 { color: var(--silver-light); font-weight: 700; }
.rank-3 { color: #D49A76; font-weight: 700; }

.delta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 5px;
}
.delta-up { background: var(--emerald-bg); color: var(--emerald); }
.delta-down { background: var(--rose-bg); color: var(--rose); }
.delta-flat { color: var(--text-dim); }

.creator-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-main);
  flex-shrink: 0;
  overflow: hidden;
}

.creator-name {
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-main);
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  background: var(--bg-base);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
}
.tier-mega { border-color: rgba(200, 164, 93, 0.45); color: var(--gold-light); }
.tier-mid { border-color: rgba(156, 163, 175, 0.4); color: var(--silver-light); }
.tier-micro { border-color: var(--border-bright); color: var(--text-muted); }

.creator-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.niche-tag {
  background: var(--bg-base);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
}

.platforms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 310px;
}

.plat-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plat-chip svg { width: 11px; height: 11px; }

.score-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.spark-bar {
  width: 74px;
  height: 4px;
  background: #23262E;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 5px;
}
.spark-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--silver) !important;
}

.ad-pill {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  padding: 6px 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.ad-open {
  background: var(--bg-surface);
  color: var(--gold-light);
  border: 1px solid var(--gold);
}
.ad-open:hover { background: rgba(200, 164, 93, 0.12); }
.ad-closed {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: default;
}

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

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
  gap: 12px;
}

.close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.close-btn:hover { color: var(--text-main); border-color: var(--silver); }

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.m-stat {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px;
}

.ch-row, .pkg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 8px;
}

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  margin-bottom: 5px;
}

.bundle-plus-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #4A4E59;
  background: var(--bg-surface);
  color: var(--silver-light);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.bundle-plus-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}
.bundle-plus-btn.selected {
  background: var(--bg-elevated);
  color: var(--emerald);
  border-color: var(--emerald);
}
.bundle-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 11px 18px;
  display: none;
  align-items: center;
  gap: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75);
  z-index: 180;
  max-width: 94vw;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--gold);
  font-weight: 500;
  font-size: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  display: none;
  z-index: 300;
}
