.leaderboard-list {
  box-sizing: border-box;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--main-padding-gap);
  margin-bottom: 5px;
  background: var(--item-bg);
  border: var(--item-border);
  border-radius: var(--item-border-radius);
  transition: all 0.3s ease;
  box-shadow: var(--item-shadow);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.leaderboard-item:hover {
  background: var(--mini-screen-element-hover);
}

.leaderboard-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.leaderboard-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
}

.country-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.country-name {
    font-weight: 500;
    font-size: var(--main-font-size);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fire-emoji {
    display: inline-block;
    animation: fire-pulse 1.5s ease-in-out infinite;
    transform-origin: center;
}
@keyframes fire-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    25% { 
        transform: scale(1.2) rotate(-5deg);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.9;
    }
    75% { 
        transform: scale(1.2) rotate(5deg);
        opacity: 0.8;
    }
}

.user-country {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--secondary-text-color);
}

.user-country .country-name {
    color: var(--secondary-text-color);
}
.leaderboard-column-headers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px 6px;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--main-text-color);
}
.leaderboard-column-headers .col-country { flex: 1; }
.leaderboard-column-headers .col-spins  { min-width: 80px; text-align: right; }
.leaderboard-column-headers .col-today  { min-width: 80px; text-align: right; }

.rank-medal {
  font-size: var(--main-font-size);
  line-height: 1;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-item {
  position: relative;
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--secondary-text-color);
  opacity: 0.25;
  transition: width 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.leaderboard-left,
.leaderboard-right {
  position: relative;
  z-index: 1;
}

.total-spins {
  text-align: right;
  min-width: 80px;
  flex-shrink: 0;
}
.today-spins {
  color: var(--secondary-text-color);
  text-align: right;
  min-width: 80px;
  flex-shrink: 0;
}

.num-updated {
  animation: numFlash 0.5s ease;
}
@keyframes numFlash {
  0%   { opacity: 1; }
  30%  { opacity: 0.3; color: var(--secondary-text-color); }
  100% { opacity: 1; }
}

.leaderboard-stats {
  border-top: 1px solid var(--main-text-color);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  padding: 10px;
  gap: 10px;
}

.total-spins-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  text-transform: uppercase;
  border-bottom: 1px solid var(--main-text-color);
  padding-bottom: 10px;
}

.total-spins-display .number {
  color: var(--secondary-text-color);
}

.today-spins-display .number {
  color: var(--secondary-text-color);
}
.user-country-info {
  justify-content: space-between;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.leaderboard-sub-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.lb-sub-tab {
  flex: 1;
  padding: 5px 10px;
  background: rgb(0, 0, 0,0.10);
  border: 1px solid var(--secondary-text-color);
  border-radius: var(--mini-screen-border-radius);
  color: var(--main-text-color);
  font-family: var(--screen-font-family);
  font-size: var(--main-font-size);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.lb-sub-tab.active {
  background: var(--mini-screen-element-hover);
  border-color: var(--secondary-text-color);
  opacity: 1;
}
.lb-sub-tab:hover:not(.active) {
  opacity: 0.8;
}
.leaderboard-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.leaderboard-view.hidden {
  display: none;
}
.tab-loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--main-text-color);
  text-align: center;
}
.tab-loading-state.show {
  display: flex;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}
.empty-state p {
    margin: 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
  .leaderboard-left {
    gap: 5px;
  }
  .rank {
    font-size: var(--mobile-font-size);
    width: 30px;
  }
  .rank-medal {
    font-size: var(--mobile-font-size);
  }
  .country-name {
    font-size: var(--mobile-font-size);
  }
  .total-spins {
    font-size: var(--mobile-font-size);
    min-width: 30px;
  }
  .today-spins {
    font-size: var(--mobile-font-size);
    min-width: 30px;
  }
  .total-spins-display .number {
    font-size:var(--mobile-font-size);
  }
  .today-spins-display .number {
    font-size: var(--mobile-font-size);
  }
  .user-country-display {
    font-size: var(--mobile-font-size);
  }
  .lb-sub-tab {
    font-size: var(--mobile-font-size);
  }
}