/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, light-dark(rgba(217, 119, 6, 0.08), rgba(245, 158, 11, 0.08)), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, light-dark(rgba(37, 99, 235, 0.06), rgba(59, 130, 246, 0.06)), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, light-dark(rgba(124, 58, 237, 0.05), rgba(139, 92, 246, 0.05)), transparent);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: light-dark(rgba(217, 119, 6, 0.1), rgba(245, 158, 11, 0.1));
  border: 1px solid light-dark(rgba(217, 119, 6, 0.2), rgba(245, 158, 11, 0.2));
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 8px;
}

.header p {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
}

/* Summary Stats Row */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-stat {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.summary-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--accent-gold));
  opacity: 0.7;
}

.summary-stat:hover {
  transform: translateY(-2px);
  border-color: var(--overlay-strong);
}

.summary-stat .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--stat-accent, var(--accent-gold));
  line-height: 1;
  margin-bottom: 4px;
}

.summary-stat .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--overlay-hover);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Leaderboard */
.leaderboard-section {
  margin-bottom: 32px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Podium */
.podium-area {
  display: flex;
  flex-direction: column;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 20px;
}

.podium-slot {
  text-align: center;
  flex: 1;
  max-width: 160px;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  margin: 0 auto 8px;
  border: 3px solid;
  position: relative;
}

/* Podium avatar styling is set via inline styles in buildPodium() */

.podium-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-pts {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

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

.podium-bar {
  border-radius: 8px 8px 0 0;
  width: 100%;
  margin-top: 8px;
  transition: height 0.6s ease;
}

.podium-legend {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

/* Podium bar heights/gradients are set via inline styles in buildPodium() */

.crown {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
}

/* Table */
.table-rest {
  flex: 1;
  margin-top: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 36px 1fr 80px 80px 70px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  gap: 8px;
}

.table-row:hover { background: var(--overlay-weak); }

.table-row .rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.table-row .name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-row .stat-val {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.table-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.table-header .stat-val { font-weight: 600; }

.leaderboard-toggle {
  border-top: 1px dashed var(--overlay-medium);
  margin-top: 4px;
}

.leaderboard-toggle .rank {
  color: var(--accent-blue);
  font-size: 16px;
  font-weight: 800;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--overlay-faint);
  border: 1px solid var(--border-card);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--overlay-medium);
  color: var(--text-primary);
  border-color: var(--overlay-strong);
}

/* Right side leaderboard chart */
.leaderboard-chart-wrap {
  display: flex;
  flex-direction: column;
}

.leaderboard-chart-wrap canvas {
  flex: 1;
}

/* Grid layouts */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.charts-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.charts-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.full-width {
  margin-bottom: 32px;
}

/* Mini leaderboard cards */
.mini-board {
  list-style: none;
}

.mini-board li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--overlay-subtle);
  transition: all 0.2s;
}

.mini-board li:last-child { border-bottom: none; }

.mini-board li:hover { padding-left: 4px; }

.mini-board .mini-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}

.mini-board .mini-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-board .mini-val {
  font-size: 14px;
  font-weight: 700;
  margin-left: 12px;
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

.mini-board .mini-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  white-space: nowrap;
  min-width: 56px;
  text-align: right;
}

.stats-grid .card {
  min-width: 0;
  overflow: hidden;
}

.mini-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.mini-right {
  display: flex;
  align-items: center;
}

/* Bar visual */
.bar-bg {
  height: 6px;
  background: var(--overlay-faint);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

/* Cumulative chart search */
.cumulative-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.cumulative-search {
  width: 100%;
  padding: 8px 12px;
  background: var(--overlay-faint);
  border: 1px solid var(--overlay-medium);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.cumulative-search:focus {
  border-color: var(--accent-gold);
}

.cumulative-search::placeholder {
  color: var(--text-muted);
}

.cumulative-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.cumulative-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.cumulative-dropdown-item:hover {
  background: var(--overlay-weak);
}

.cumulative-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.cumulative-chips:empty {
  display: none;
}

.cumulative-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--overlay-faint);
}

.cumulative-chip-x {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cumulative-chip-x:hover {
  opacity: 1;
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.chart-container canvas {
  width: 100% !important;
}

/* Year filter */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--overlay-faint);
  border: 1px solid var(--overlay-medium);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
  background: var(--overlay-medium);
  color: var(--text-primary);
}

.filter-btn.active {
  background: light-dark(rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15));
  border-color: light-dark(rgba(217, 119, 6, 0.3), rgba(245, 158, 11, 0.3));
  color: var(--accent-gold);
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 4px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.year-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.year-pill {
  background: var(--overlay-faint);
  border: 1px solid var(--overlay-medium);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.year-pill:hover {
  background: var(--overlay-medium);
  color: var(--text-primary);
}

.year-pill.active {
  background: light-dark(rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.15));
  border-color: light-dark(rgba(37, 99, 235, 0.35), rgba(59, 130, 246, 0.35));
  color: var(--accent-blue);
}

.year-pill-more {
  font-style: italic;
  color: var(--text-muted);
  border-style: dashed;
}

#all-time-btn.active {
  background: light-dark(rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15));
  border-color: light-dark(rgba(217, 119, 6, 0.3), rgba(245, 158, 11, 0.3));
  color: var(--accent-gold);
}

.min-t-slider {
  width: 120px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.min-t-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 20px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Animations */
.fade-in { animation: fadeIn 0.6s ease; }

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

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* Responsive */

/* Tablet */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid-3 { grid-template-columns: 1fr; }
  .leaderboard-grid { grid-template-columns: 1fr; }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
  .container { padding: 16px 12px; }
  .card { padding: 20px 16px; }

  /* Header */
  .header { margin-bottom: 28px; }
  .header-tools { position: static; display: flex; justify-content: center; margin-bottom: 12px; }
  .header p { font-size: 13px; }

  /* Summary stats */
  .summary-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .summary-stat { padding: 14px 12px; }
  .summary-stat .number { font-size: 1.5rem; }

  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  .filter-group { flex-wrap: wrap; }
  .spotlight-search-wrap { min-width: 0; width: 100%; }

  /* Leaderboard */
  .charts-grid-2 { grid-template-columns: 1fr; }
  .podium { gap: 8px; padding-top: 12px; margin-bottom: 16px; }
  .podium-slot { max-width: 120px; }
  .podium-avatar { width: 44px; height: 44px; font-size: 15px; }
  .podium-name { font-size: 12px; }
  .podium-pts { font-size: 15px; }
  .podium-sub { font-size: 10px; }

  /* Table */
  .table-row { grid-template-columns: 30px 1fr 60px 60px; gap: 4px; padding: 8px 8px; }
  .table-row .stat-val:last-child { display: none; }
  .table-header { font-size: 9px; }

  /* Charts */
  .chart-container { min-height: 220px; }

  /* Spotlight card */
  .spotlight-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  .spotlight-card-stats { gap: 12px; }
  .spotlight-search-wrap { min-width: 0; }

  /* Trend controls */
  .trend-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .trend-slider-wrap { flex-wrap: wrap; }

  /* Yearly top 5 */
  .yearly-top5 th, .yearly-top5 td { padding: 8px 10px; }

  /* Spacing */
  .full-width { margin-bottom: 20px; }
  .leaderboard-section { margin-bottom: 20px; }
  .stats-grid { gap: 12px; margin-bottom: 20px; }
  .charts-grid-2 { gap: 16px; margin-bottom: 20px; }
  .card-title { font-size: 12px; letter-spacing: 1px; margin-bottom: 14px; }

  /* Footer */
  .footer { font-size: 11px; padding: 24px 0 16px; }
}

/* Phone */
@media (max-width: 480px) {
  .container { padding: 12px 8px; }
  .card { padding: 16px 12px; }

  /* Header */
  .header h1 { font-size: 1.6rem; letter-spacing: -0.5px; }
  .header p { font-size: 12px; padding: 0 8px; }
  .header-badge { font-size: 10px; padding: 4px 12px; letter-spacing: 1px; }

  /* Summary stats */
  .summary-stat .number { font-size: 1.3rem; }
  .summary-stat .label { font-size: 10px; letter-spacing: 0.5px; }

  /* Stats grid */
  .stats-grid { grid-template-columns: 1fr; }

  /* Modal stats */
  .modal-stats { grid-template-columns: repeat(2, 1fr); }

  /* Filter bar */
  .filter-bar { padding: 12px; gap: 10px; }
  .filter-label { font-size: 11px; width: 100%; margin-bottom: 2px; }
  .year-pills { gap: 4px; }
  .year-pill { padding: 4px 10px; font-size: 11px; }
  .min-t-slider { width: 100px; }

  /* Podium */
  .podium { gap: 6px; }
  .podium-slot { max-width: 100px; }
  .podium-avatar { width: 38px; height: 38px; font-size: 13px; border-width: 2px; }
  .podium-name { font-size: 11px; }
  .podium-pts { font-size: 13px; }
  .crown { font-size: 16px; top: -14px; }

  /* Table */
  .table-row { grid-template-columns: 24px 1fr 52px 52px; font-size: 12px; padding: 7px 6px; gap: 4px; }
  .table-row .rank { font-size: 11px; }
  .table-row .name { font-size: 12px; }
  .table-row .stat-val { font-size: 12px; }

  /* Mini boards */
  .mini-board .mini-name { font-size: 12px; }
  .mini-board .mini-val { font-size: 13px; }
  .mini-board .mini-sub { font-size: 10px; margin-left: 4px; min-width: 44px; }
  .mini-board .mini-rank { width: 20px; height: 20px; font-size: 10px; margin-right: 8px; }

  /* Chart containers */
  .chart-container { min-height: 200px; }

  /* Spotlight card */
  .spotlight-card-avatar { width: 40px; height: 40px; font-size: 14px; }
  .spotlight-card-name { font-size: 14px; }
  .spotlight-stat .ss-val { font-size: 1rem; }
  .spotlight-stat .ss-label { font-size: 9px; }

  /* Trend slider */
  .trend-slider { width: 100px; }
  .trend-slider-label { font-size: 12px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Clickable rows */
.clickable { cursor: pointer; }

/* Header tools */
.header-tools {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
}

.header-tools .theme-toggle {
  position: static;
}

/* Data source indicator */
.data-source-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.data-source-info a {
  text-decoration: none;
  font-weight: 500;
}

.data-source-info a:hover {
  text-decoration: underline;
}

/* Yearly Top 5 Table */
.yearly-top5-wrap {
  overflow-x: auto;
}

.yearly-top5 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.yearly-top5 th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-card);
}

.yearly-top5 td {
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid var(--overlay-subtle);
  vertical-align: middle;
}

.yearly-top5 tbody tr:last-child td {
  border-bottom: none;
}

.yearly-top5 .yt5-separator td {
  padding: 0;
  border-bottom: 2px dashed var(--text-muted);
}

.yearly-top5 tbody tr:hover td {
  background: var(--overlay-weak);
}

.yt5-year {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.yt5-player {
  border-left: 3px solid var(--pc);
  background: color-mix(in srgb, var(--pc) 6%, transparent);
}

.yt5-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.yt5-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Win % Trend controls */
.trend-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.trend-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.trend-slider-label {
  font-weight: 500;
  color: var(--text-muted);
}

.trend-slider {
  width: 140px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

.trend-slider-value {
  font-weight: 700;
  color: var(--accent-emerald);
  min-width: 24px;
  text-align: center;
}

.trend-slider-unit {
  color: var(--text-muted);
  font-size: 12px;
}

.trend-fallback-note {
  background: var(--overlay-faint);
  border-left: 3px solid var(--accent-orange);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ===== Player Spotlight ===== */

.spotlight-group {
  position: relative;
}

.spotlight-search-wrap {
  position: relative;
  min-width: 200px;
}

.spotlight-search {
  width: 100%;
  padding: 6px 32px 6px 12px;
  background: var(--overlay-faint);
  border: 1px solid var(--overlay-medium);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.spotlight-search:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px light-dark(rgba(217, 119, 6, 0.1), rgba(245, 158, 11, 0.1));
}

.spotlight-search::placeholder {
  color: var(--text-muted);
}

.spotlight-clear {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--overlay-faint);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  align-items: center;
  justify-content: center;
}

.spotlight-clear:hover {
  background: var(--overlay-medium);
  color: var(--text-primary);
}

.spotlight-clear.visible {
  display: flex;
}

.spotlight-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.spotlight-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spotlight-dropdown-item:hover {
  background: var(--overlay-weak);
}

.spotlight-dropdown-rank {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Spotlight stat card */
.spotlight-card {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 24px;
  border-left: 3px solid var(--accent-gold);
  cursor: pointer;
}

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

.spotlight-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: light-dark(rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15));
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.spotlight-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.spotlight-card-rank {
  font-size: 12px;
  color: var(--text-muted);
}

.spotlight-card-rank.spotlight-not-active {
  margin-top: 4px;
  padding: 4px 10px;
  background: light-dark(rgba(234, 88, 12, 0.15), rgba(249, 115, 22, 0.15));
  color: var(--accent-orange);
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

.spotlight-card-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.spotlight-stat {
  text-align: center;
}

.spotlight-stat .ss-val {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.spotlight-stat .ss-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Spotlight highlight on existing elements */
.spotlight-active {
  position: relative;
}

.spotlight-active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--accent-gold);
  border-radius: 10px;
  pointer-events: none;
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Injected rows for players outside top N */
.spotlight-injected {
  border-top: 1px dashed var(--accent-gold) !important;
  margin-top: 4px;
  background: light-dark(rgba(217, 119, 6, 0.05), rgba(245, 158, 11, 0.05));
}

.mini-board li.spotlight-injected {
  border-top: 1px dashed var(--accent-gold);
  border-bottom: none;
  margin-top: 4px;
  padding-top: 12px;
  background: light-dark(rgba(217, 119, 6, 0.05), rgba(245, 158, 11, 0.05));
  border-radius: 0 0 8px 8px;
}

/* Yearly top 5 highlight */
.yt5-player.spotlight-active::after {
  border-radius: 0;
  inset: 0;
}

/* Podium spotlight — highlight the avatar */
.podium-slot.spotlight-active::after {
  border-radius: 12px;
  inset: -4px;
}

.podium-slot.spotlight-active .podium-avatar {
  box-shadow: 0 0 16px light-dark(rgba(217, 119, 6, 0.4), rgba(245, 158, 11, 0.4));
}

/* Table row spotlight */
.table-row.spotlight-active {
  background: light-dark(rgba(217, 119, 6, 0.08), rgba(245, 158, 11, 0.08));
}

.table-row.spotlight-active::after {
  border-radius: 8px;
}

