/* Leaderboard Modal */
.leaderboard-modal-content {
  width: 900px;
  margin-top: 80px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(245, 222, 179, 0.98) 0%, rgba(222, 184, 135, 0.98) 100%);
  border-radius: 12px;
  border: 3px solid rgba(139, 90, 43, 0.9);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 90, 43, 0.3);
  max-height: 85vh;
  overflow-y: auto;
}

.leaderboard-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.leaderboard-modal-title {
  color: #3e2723;
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
  -webkit-text-stroke: 0;
}

.leaderboard-close-button {
  background: rgba(139, 90, 43, 0.3);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  color: #3e2723;
  padding: 4px 10px;
  transition: all 0.2s;
}

.leaderboard-close-button:hover:not(:disabled) {
  background: rgba(139, 90, 43, 0.4);
  border-color: rgba(139, 90, 43, 0.7);
  color: #2c1810;
}

/* Leaderboard Styles */
.leaderboard-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 8px;
}

.leaderboard-card {
  background: linear-gradient(135deg, rgba(245, 222, 179, 0.98) 0%, rgba(222, 184, 135, 0.98) 100%);
  border: 3px solid rgba(139, 90, 43, 0.8);
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.leaderboard-title {
  color: #3e2723;
  -webkit-text-stroke: 0;
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-title::before {
  content: '🏆';
}

.leaderboard-refresh {
  background: none;
  border: none;
  padding: 4px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}

.leaderboard-refresh:hover:not(:disabled) {
  opacity: 1;
}

.leaderboard-refresh:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Leaderboard Tabs */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
}

.leaderboard-tab {
  background: transparent;
  border: 2px solid rgba(139, 90, 43, 0.4);
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #5a4030;
  cursor: pointer;
  opacity: 0.7;
}

.leaderboard-tab:hover {
  opacity: 1;
}

.leaderboard-tab-active {
  background: linear-gradient(135deg, rgba(222, 184, 135, 0.8) 0%, rgba(205, 164, 116, 0.8) 100%);
  border-color: rgba(139, 90, 43, 0.6);
  color: #3e2723;
  opacity: 1;
}

/* Leaderboard States */
.leaderboard-loading,
.leaderboard-error {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #5a4030;
}

.leaderboard-error {
  color: #a33;
}

.leaderboard-empty {
  text-align: center;
  padding: 40px 20px;
}

.leaderboard-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.leaderboard-empty-text {
  font-size: 18px;
  font-weight: 600;
  color: #3e2723;
  margin-bottom: 4px;
}

.leaderboard-empty-subtext {
  font-size: 14px;
  color: #5a4030;
  opacity: 0.8;
}

/* Leaderboard List */
.leaderboard-list {
  background: linear-gradient(135deg, rgba(222, 184, 135, 0.5) 0%, rgba(205, 164, 116, 0.5) 100%);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 10px;
  overflow: hidden;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.3);
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.6) 0%, rgba(245, 235, 220, 0.6) 100%);
}

.leaderboard-entry:last-child {
  border-bottom: none;
}

.leaderboard-entry:hover {
  background: linear-gradient(135deg, rgba(255, 255, 250, 0.85) 0%, rgba(250, 245, 235, 0.85) 100%);
}

/* Rank styles */
.leaderboard-rank-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 200, 50, 0.25) 100%) !important;
}

.leaderboard-rank-silver {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.25) 0%, rgba(180, 180, 180, 0.25) 100%) !important;
}

.leaderboard-rank-bronze {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(180, 110, 40, 0.2) 100%) !important;
}

.leaderboard-entry-rank {
  min-width: 40px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #3e2723;
}

.leaderboard-entry-rank-emoji {
  font-size: 40px;
}

.leaderboard-entry-sprites {
  display: flex;
  gap: 4px;
  align-items: center;
}

.leaderboard-sprite {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.leaderboard-entry-main {
  flex: 1;
  min-width: 0;
}

.leaderboard-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.leaderboard-entry-name {
  font-size: 16px;
  font-weight: 700;
  color: #3e2723;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-entry-name.winner {
  font-size: 24px;
}

.leaderboard-entry-name.second {
  font-size: 21px;
}

.leaderboard-entry-name.third {
  font-size: 18px;
}

.leaderboard-entry-party {
  font-size: 14px;
  opacity: 0.9;
}

.leaderboard-entry-heroes {
  font-size: 12px;
  color: #5a4030;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-entry-stats {
  text-align: right;
  flex-shrink: 0;
}

.leaderboard-entry-progress {
  font-size: 15px;
  font-weight: 700;
  color: #3e2723;
  margin-bottom: 2px;
}

.leaderboard-stat-label {
  color: #5a4030;
  font-weight: 600;
}

.leaderboard-stat-value {
  color: #3e2723;
  margin-left: 2px;
}

.leaderboard-entry-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #5a4030;
  justify-content: flex-end;
}

/* Leaderboard Footer */
.leaderboard-footer {
  text-align: center;
  padding-top: 8px;
  font-size: 13px;
  color: #5a4030;
  opacity: 0.8;
}
