/**
 * Move the Money Across Africa · STARKS
 * Leaderboard & 55" Booth Screen Mirror Stylesheet
 * Strictly adhering to Starks Brand Guidelines (Sep 2026)
 */

/* Leaderboard Screen Only - Hide Map completely */
.screen-leaderboard #map-render-root,
#view-leaderboard.active ~ #map-render-root,
#view-leaderboard.active + #map-render-root,
body.leaderboard-standalone-page #map-render-root {
  display: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   1. Leaderboard Screen View (#view-leaderboard) & Modal Container
   ========================================================================== */
#view-leaderboard {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px 80px 24px;
  position: relative;
  z-index: 20;
}

#view-leaderboard.active {
  display: block;
}

.btn-lb-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color, #262626);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 40px;
  margin-right: 10px;
}

.btn-lb-back:hover,
.btn-lb-back:active {
  background: rgba(221, 90, 32, 0.15);
  border-color: var(--starks-orange, #DD5A20);
  color: var(--starks-orange, #DD5A20);
}

/* Standalone Modal Overlay */
.leaderboard-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(4, 4, 4, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.leaderboard-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(221, 90, 32, 0.15);
  animation: lbModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lbModalSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Container Wrapper inside Modal or View */
.leaderboard-container {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   2. Header & Navigation Controls
   ========================================================================== */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 13, 13, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
}

.leaderboard-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-title-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.leaderboard-heading-text h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.leaderboard-subheading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--starks-almond);
  text-transform: uppercase;
}

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

.btn-lb-refresh {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-lb-refresh:hover, .btn-lb-refresh:active {
  background: var(--starks-orange);
  color: #040404;
  border-color: var(--starks-orange);
  transform: rotate(180deg);
}

.btn-lb-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-lb-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. Pinned My Rank Spotlight at Top
   ========================================================================== */
.my-rank-spotlight-card {
  position: relative;
  background: linear-gradient(135deg, rgba(221, 90, 32, 0.18) 0%, rgba(69, 32, 124, 0.22) 100%), var(--bg-card);
  border: 1.5px solid var(--starks-orange);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 14px 20px 0 20px;
  box-shadow: 0 4px 20px rgba(221, 90, 32, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease;
  overflow: hidden;
}

.my-rank-spotlight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--starks-orange);
}

.spotlight-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--starks-orange);
  color: #040404;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.spotlight-percentile {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--starks-gold);
  background: rgba(238, 119, 42, 0.12);
  border: 1px solid rgba(238, 119, 42, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.spotlight-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spotlight-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spotlight-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-company-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.spotlight-rank-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.spotlight-rank-num {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--starks-orange);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spotlight-rank-total {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.spotlight-score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 14px;
}

.spotlight-score-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.spotlight-score-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Unranked empty state */
.spotlight-unranked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.unranked-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.btn-spotlight-play {
  background: var(--starks-orange);
  color: #040404;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-spotlight-play:hover {
  background: var(--starks-gold);
}

/* ==========================================================================
   4. Filter Tabs & Controls
   ========================================================================== */
.leaderboard-filters-wrap {
  padding: 12px 20px 6px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Timeframe Tabs: All-Time vs Today's Daily Cup */
.timeframe-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--starks-orange);
  color: #040404;
  box-shadow: 0 2px 10px rgba(221, 90, 32, 0.35);
}

/* Role / Sector Pill Filters */
.role-filters-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.role-filters-scroll::-webkit-scrollbar {
  display: none;
}

.role-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.role-pill:hover {
  border-color: var(--starks-almond);
  color: var(--text-primary);
}

.role-pill.active {
  background: rgba(221, 90, 32, 0.15);
  border-color: var(--starks-orange);
  color: var(--starks-orange);
  font-weight: 800;
}

/* ==========================================================================
   5. Top 10 Hall of Fame Standings List
   ========================================================================== */
.leaderboard-content-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hall-of-fame-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 6px 0 4px 0;
  padding: 0 4px;
}

.live-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--starks-green);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--starks-green);
  animation: pulseGreen 1.6s infinite ease-in-out;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px var(--starks-green); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Leaderboard Row Card */
.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.lb-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Highlight for user row */
.lb-row.current-user-row {
  border: 1.5px solid var(--starks-orange);
  background: rgba(221, 90, 32, 0.1);
  box-shadow: 0 0 15px rgba(221, 90, 32, 0.2);
}

.lb-row.current-user-row .lb-name::after {
  content: "YOU";
  display: inline-block;
  background: var(--starks-orange);
  color: #040404;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
  vertical-align: middle;
}

/* Podium Styles: 1st, 2nd, 3rd */
.lb-row.rank-1 {
  background: linear-gradient(90deg, rgba(238, 119, 42, 0.14) 0%, rgba(20, 20, 20, 0.8) 100%);
  border-color: rgba(238, 119, 42, 0.6);
}

.lb-row.rank-2 {
  background: linear-gradient(90deg, rgba(163, 156, 178, 0.12) 0%, rgba(20, 20, 20, 0.8) 100%);
  border-color: rgba(163, 156, 178, 0.5);
}

.lb-row.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.12) 0%, rgba(20, 20, 20, 0.8) 100%);
  border-color: rgba(205, 127, 50, 0.5);
}

/* Rank Medal Badge */
.lb-rank-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-secondary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-1 .lb-rank-badge {
  background: radial-gradient(circle at 40% 35%, rgba(255, 215, 0, 0.25) 0%, rgba(238, 119, 42, 0.12) 60%, rgba(14, 14, 16, 0.9) 100%);
  color: #FFD700;
  border-color: var(--starks-gold);
  box-shadow: 0 0 14px rgba(221, 90, 32, 0.45);
}

.rank-2 .lb-rank-badge {
  background: radial-gradient(circle at 40% 35%, rgba(241, 245, 249, 0.2) 0%, rgba(163, 156, 178, 0.12) 60%, rgba(14, 14, 16, 0.9) 100%);
  color: #E2E8F0;
  border-color: #dcd6e8;
  box-shadow: 0 0 12px rgba(220, 214, 232, 0.35);
}

.rank-3 .lb-rank-badge {
  background: radial-gradient(circle at 40% 35%, rgba(245, 158, 11, 0.2) 0%, rgba(205, 127, 50, 0.12) 60%, rgba(14, 14, 16, 0.9) 100%);
  color: #F59E0B;
  border-color: #cd7f32;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.35);
}

.medal-svg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.medal-icon {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}

.lb-row:hover .medal-icon {
  transform: scale(1.1);
}

/* Identity & Profile */
.lb-identity-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.lb-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-company {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--starks-almond);
  background: rgba(250, 154, 96, 0.1);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

/* Scores & Performance */
.lb-metrics-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.lb-score-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--starks-orange);
  line-height: 1.1;
}

.rank-1 .lb-score-val {
  color: var(--starks-gold);
}

.lb-time-val {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Loading & Empty States */
.lb-loading-state, .lb-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(221, 90, 32, 0.2);
  border-top-color: var(--starks-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   6. Footer CTA Area
   ========================================================================== */
.leaderboard-footer-actions {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 13, 13, 0.95);
  display: flex;
  gap: 12px;
}

.btn-lb-primary {
  flex: 1;
  background: var(--starks-orange);
  color: #040404;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-lb-primary:hover {
  background: var(--starks-gold);
}

.btn-lb-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-lb-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* ==========================================================================
   7. 55" Booth Screen Live Mirror (Crowd Display)
   ========================================================================== */
/* Celebratory Top-10 Alert Banner */
.crowd-celebration-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-150px);
  width: 90%;
  max-width: 960px;
  background: linear-gradient(135deg, #DD5A20 0%, #45207C 100%);
  border: 2px solid var(--starks-gold);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  box-shadow: 0 10px 40px rgba(221, 90, 32, 0.6), 0 0 60px rgba(69, 32, 124, 0.5);
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.crowd-celebration-banner.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
  animation: bannerPulseGlow 2s infinite alternate ease-in-out;
}

@keyframes bannerPulseGlow {
  from { box-shadow: 0 10px 40px rgba(221, 90, 32, 0.6); }
  to { box-shadow: 0 15px 60px rgba(238, 119, 42, 0.9); }
}

.celebration-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #040404;
  border: 2px solid var(--starks-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

.celebration-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.celebration-tagline {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #040404;
  background: var(--starks-gold);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  width: fit-content;
  text-transform: uppercase;
}

.celebration-headline {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.celebration-headline strong {
  color: var(--starks-almond);
}

.celebration-rank-pill {
  background: #040404;
  color: var(--starks-gold);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  border: 1px solid var(--starks-gold);
}

/* 55" Booth Crowd Stage Layout */
.crowd-stage-split {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  padding: 20px 40px;
  align-items: start;
}

.crowd-board-card {
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
}

.crowd-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.crowd-board-title h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Crowd Live Standings Table */
.crowd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.crowd-table th {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: left;
  padding: 8px 12px;
}

.crowd-table td {
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.crowd-table tr td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 900;
  width: 60px;
}

.crowd-table tr td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
  font-weight: 800;
}

.crowd-table tr.top-1 td {
  background: rgba(238, 119, 42, 0.18);
  border-top: 1px solid var(--starks-gold);
  border-bottom: 1px solid var(--starks-gold);
}

.crowd-table tr.top-1 td:first-child {
  border-left: 2px solid var(--starks-gold);
  color: var(--starks-gold);
}

.crowd-table tr.top-1 td:last-child {
  border-right: 1px solid var(--starks-gold);
}

/* Animated marquee ticker for crowd view */
.crowd-ticker-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #040404;
  border-top: 1px solid rgba(221, 90, 32, 0.3);
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}

.crowd-ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: marqueeTicker 30s linear infinite;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

@keyframes marqueeTicker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 48px;
}

.ticker-item .highlight {
  color: var(--starks-orange);
  font-weight: 800;
}

/* ==========================================================================
   8. Responsive Optimization (Mobile Portrait)
   ========================================================================== */
@media screen and (max-width: 600px) and (orientation: portrait) {
  #view-leaderboard {
    padding: 12px 12px 60px 12px;
  }

  .leaderboard-modal-backdrop {
    padding: 0;
  }

  .leaderboard-modal-content {
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .my-rank-spotlight-card {
    margin: 10px 12px 0 12px;
    padding: 14px 16px;
  }

  .spotlight-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .spotlight-stats-group {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
  }

  .spotlight-score-display {
    border-left: none;
    padding-left: 0;
  }

  .leaderboard-filters-wrap {
    padding: 10px 12px 4px 12px;
  }

  .leaderboard-content-scroll {
    padding: 6px 12px 16px 12px;
  }

  .lb-row {
    padding: 10px 12px;
  }

  .lb-rank-badge {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .lb-name {
    font-size: 0.95rem;
  }

  .lb-score-val {
    font-size: 1.05rem;
  }

  .leaderboard-footer-actions {
    padding: 12px;
  }

  .crowd-stage-split {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}

/* ==========================================================================
   9. Desktop Progressive Enhancement (min-width: 1024px)
   ========================================================================== */
@media screen and (min-width: 1024px) {
  .leaderboard-modal-content {
    max-width: 860px;
    border-radius: 24px;
  }

  .leaderboard-container {
    max-width: 840px;
  }

  #view-leaderboard {
    padding: 32px 40px 80px 40px;
  }

  .my-rank-spotlight-card {
    padding: 20px 28px;
  }
}

/* ==========================================================================
   10. Theme Support: Light & Dark Mode
   ========================================================================== */
[data-theme="light"] #view-leaderboard {
  background: #FFFFFF;
}

[data-theme="light"] .leaderboard-container,
[data-theme="light"] .leaderboard-modal-content {
  background: #FFFFFF;
  color: #040404;
  border: 1px solid rgba(60, 60, 60, 0.14);
}

[data-theme="light"] .leaderboard-header {
  background: #FFFFFF;
  border-bottom: 1px solid rgba(60, 60, 60, 0.1);
}

[data-theme="light"] .leaderboard-heading-text h2 {
  color: #040404;
}

[data-theme="light"] .leaderboard-subheading {
  color: #3C3C3C;
}

[data-theme="light"] .btn-lb-close {
  color: #3C3C3C;
}

[data-theme="light"] .btn-lb-close:hover {
  color: #040404;
  background: rgba(60, 60, 60, 0.08);
}

[data-theme="light"] .btn-lb-refresh {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.14);
  color: #3C3C3C;
}

[data-theme="light"] .btn-lb-back {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.14);
  color: #040404;
}

/* Pinned Spotlight Card */
[data-theme="light"] .my-rank-spotlight-card {
  background: #FFF7F2;
  border: 1.5px solid #DD5A20;
  color: #040404;
  box-shadow: 0 4px 16px rgba(221, 90, 32, 0.12);
}

[data-theme="light"] .spotlight-name {
  color: #040404;
}

[data-theme="light"] .spotlight-company-role {
  color: #3C3C3C;
}

[data-theme="light"] .spotlight-rank-num {
  color: #DD5A20;
}

[data-theme="light"] .spotlight-rank-total {
  color: #3C3C3C;
}

[data-theme="light"] .spotlight-score-val {
  color: #040404;
}

[data-theme="light"] .spotlight-score-label {
  color: #3C3C3C;
}

[data-theme="light"] .spotlight-score-display {
  border-left-color: rgba(60, 60, 60, 0.15);
}

[data-theme="light"] .unranked-message {
  color: #3C3C3C;
}

[data-theme="light"] .btn-spotlight-play {
  background: #DD5A20;
  color: #040404;
}

/* Tabs & Filter Pills */
[data-theme="light"] .timeframe-tabs {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.12);
}

[data-theme="light"] .tab-btn {
  background: #F4F3F7;
  color: #3C3C3C;
}

[data-theme="light"] .tab-btn.active {
  background: #DD5A20;
  color: #040404;
  box-shadow: 0 2px 10px rgba(221, 90, 32, 0.25);
}

[data-theme="light"] .role-pill {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.12);
  color: #3C3C3C;
}

[data-theme="light"] .role-pill:hover {
  border-color: #DD5A20;
  color: #040404;
}

[data-theme="light"] .role-pill.active {
  background: #DD5A20;
  color: #040404;
  border-color: #DD5A20;
}

/* Leaderboard Rows */
[data-theme="light"] .lb-row {
  background: #F8F9FA;
  border: 1px solid rgba(60, 60, 60, 0.1);
  color: #040404;
}

[data-theme="light"] .lb-row:hover {
  background: #FFF7F2;
}

[data-theme="light"] .lb-name {
  color: #040404;
}

[data-theme="light"] .lb-company {
  color: #3C3C3C;
}

[data-theme="light"] .lb-time-val {
  color: #6a6478;
}

[data-theme="light"] .lb-rank-badge {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.15);
  color: #3C3C3C;
}

/* Current user highlight */
[data-theme="light"] .current-user-row,
[data-theme="light"] .lb-row.current-user-row {
  background: rgba(221, 90, 32, 0.12);
  border-color: #DD5A20;
}

[data-theme="light"] .lb-row.current-user-row .lb-name::after {
  background: #DD5A20;
  color: #040404;
}

/* Podium Rows */
[data-theme="light"] .lb-row.rank-1 {
  background: linear-gradient(90deg, rgba(238, 119, 42, 0.14) 0%, #FFFFFF 100%);
  border-color: rgba(238, 119, 42, 0.5);
}

[data-theme="light"] .lb-row.rank-2 {
  background: linear-gradient(90deg, rgba(163, 156, 178, 0.14) 0%, #FFFFFF 100%);
  border-color: rgba(163, 156, 178, 0.4);
}

[data-theme="light"] .lb-row.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.14) 0%, #FFFFFF 100%);
  border-color: rgba(205, 127, 50, 0.4);
}

[data-theme="light"] .hall-of-fame-title {
  color: #3C3C3C;
}

[data-theme="light"] .lb-loading-state,
[data-theme="light"] .lb-empty-state {
  color: #3C3C3C;
}

/* Footer CTAs */
[data-theme="light"] .leaderboard-footer-actions {
  background: #FFFFFF;
  border-top: 1px solid rgba(60, 60, 60, 0.1);
}

[data-theme="light"] .btn-lb-primary {
  background: #DD5A20;
  color: #040404;
}

[data-theme="light"] .btn-lb-secondary {
  background: #F4F3F7;
  border: 1px solid rgba(60, 60, 60, 0.15);
  color: #040404;
}

/* Explicit [data-theme="dark"] preserving dark mode styles */
[data-theme="dark"] #view-leaderboard {
  background: transparent;
}

[data-theme="dark"] .leaderboard-container,
[data-theme="dark"] .leaderboard-modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .lb-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .my-rank-spotlight-card {
  background: linear-gradient(135deg, rgba(221, 90, 32, 0.18) 0%, rgba(69, 32, 124, 0.22) 100%), var(--bg-card);
  border: 1.5px solid var(--starks-orange);
  color: var(--text-primary);
}
