#statsOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 1);
  padding: 40px;
  z-index: 9999;
  color: white;
  overflow-y: auto;
  font-family: 'Noto Sans', sans-serif;
}

.close-button {
  position: fixed;
  top: 30px;
  right: 30px;
  padding: 12px;
  background: rgba(255, 215, 0, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 32px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  z-index: 1001;
}

.close-button:hover {
  transform: scale(1.1);
  background: #ffd700;
}

.user-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.global-stats-button {
  padding: 15px 30px;
  font-size: 24px;
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid #ffd700;
  border-radius: 8px;
  color: #ffd700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-stats-button:hover {
  background: rgba(255, 215, 0, 0.3);
  transform: scale(1.05);
}

.global-stats-button:disabled {
  background: rgba(255, 215, 0, 0.4);
  cursor: default;
  transform: none;
}

.global-stats-button i {
  font-size: 28px;
}

.user-select-divider {
  position: relative;
  width: 100%;
  text-align: center;
  margin: 10px 0;
}

.user-select-divider::before,
.user-select-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 100px);
  height: 2px;
  background: rgba(255, 215, 0, 0.3);
}

.user-select-divider::before {
  left: 0;
}

.user-select-divider::after {
  right: 0;
}

.user-select-divider span {
  background: #000;
  padding: 0 20px;
  color: #ffd700;
  font-size: 18px;
  opacity: 0.8;
}

.stats-view-tabs {
  display: flex;
  gap: 10px;
  background: rgba(255, 215, 0, 0.1);
  padding: 5px;
  border-radius: 8px;
}

.stats-view-tab {
  padding: 12px 24px;
  font-size: 20px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #ffd700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-view-tab:hover:not(.active) {
  background: rgba(255, 215, 0, 0.15);
}

.stats-view-tab.active {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.stats-view-tab i {
  font-size: 20px;
}

.user-select-wrapper {
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-select-wrapper.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.user-selector select {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 12px 24px;
  font-size: 20px;
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid #ffd700;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  min-width: 200px;
  text-align: center;
  text-transform: uppercase;
  background-image:
    linear-gradient(45deg, transparent 50%, gray 50%),
    linear-gradient(135deg, gray 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) calc(1em + 2px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.user-selector select:focus {
  outline: none;
  background: rgba(255, 215, 0, 0.3);
  background-image:
    linear-gradient(45deg, transparent 50%, gray 50%),
    linear-gradient(135deg, gray 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) calc(1em + 2px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.user-selector select option {
  background: #000;
  color: white;
  padding: 10px;
}

.user-selector label {
  color: #ffd700;
  font-size: 18px;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.tab-button {
  font-size: 28px;
  padding: 15px 40px;
  background: rgba(255, 215, 0, 0.15);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tab-button.active {
  background: rgba(255, 215, 0, 0.9);
  color: black;
}

.tab-button:hover:not(.active) {
  background: rgba(255, 215, 0, 0.3);
}

.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 30px;
  padding-bottom: 100px;
}

.tab-content.active {
  display: grid;
  opacity: 1;
}

/* Remove grid from child containers since it's handled by tab-content */
#playerStats {
  padding-bottom: 100px;
}

.leaderboard-section {
  grid-column: 1 / -1; /* Make it span all columns */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 30px;
  padding-bottom: 100px;
}

#gameHistory {
  grid-template-columns: 1fr; /* Single column for game history */
}

.game-history-table {
  width: 100%;
  padding: 30px;
  grid-column: 1 / -1; /* Make it span all columns */
}

.leaderboard-category {
  margin: 0;
  padding: 30px;
  border: 2px solid #333;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.leaderboard-title {
  font-size: 36px;
  color: #ffd700;
  text-align: center;
  margin: 0 0 30px 0;
  cursor: help;
  position: relative;
}

.leaderboard-title[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 215, 0, 0.95);
  color: black;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 18px;
  max-width: 300px;
  white-space: normal;
  text-align: center;
  z-index: 1000;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin: 12px 0;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  font-size: 28px;
}

.leaderboard-rank {
  font-size: 32px;
  font-weight: bold;
  color: #ffd700;
  min-width: 50px;
}

.leaderboard-name {
  flex-grow: 1;
  font-weight: bold;
  font-family: 'Bungee' , sans-serif;
}

.leaderboard-name .player-owner,
.player-header .player-owner {
  font-family: 'Noto Sans', sans-serif;
  font-weight: normal;
  text-transform: uppercase;
  font-size: 20px;
}


.leaderboard-name h3 {
  margin: 0;
  color: #fff;
}   

.leaderboard-value {
  color: #ffd700;
  font-weight: bold;
  font-size: 32px;
}

.key-stat {
  font-size: 32px;
  font-weight: bold;
  color: #ffd700;
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.key-stat-icon {
  font-size: 36px;
}

.key-stat-value {
  color: white;
  margin-left: auto;
}

.awards-section {
  margin-top: 40px;
  padding: 25px;
  background: rgba(255, 215, 0, 0.08);
  border-radius: 12px;
}

.awards-title {
  font-size: 28px;
  font-weight: bold;
  color: #ffd700;
  margin: 0 0 20px 0;
  text-align: center;
}

.award-item {
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  margin: 12px 0;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 8px;
  cursor: help;
  position: relative;
}

.award-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 215, 0, 0.95);
  color: black;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 18px;
  max-width: 300px;
  white-space: normal;
  text-align: center;
  z-index: 1000;
}

.award-icon {
  font-size: 28px;
}

.award-count {
  margin-left: auto;
  color: #ffd700;
  font-weight: bold;
  font-size: 26px;
}

#statsOverlay h2 {
  color: #ffd700;
  text-align: center;
  margin: 20px 0 40px 0;
  font-size: 48px;
}

.player-card {
  margin: 0;
  padding: 30px;
  border: 2px solid #333;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.player-card h3 {
  margin: 0 0 30px 0;
  font-size: 36px;
  text-align: center;
}

.player-header {
  color: #ffd700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.player-header h3 {
  margin: 0;
}

.player-name {
  font-size: 22px;
  color: white;
  text-transform: uppercase;
}

.player-beers {
  font-size: 16px;
  color: #ffd700;
  opacity: 0.9;
  margin: 5px 0;
}

.player-owner {
  font-size: 16px; 
  color: #ffd700;
  opacity: 0.9;
  margin-top: 5px;
}

.player-owner span {
  color: #fff;
}

/* Game History Styles */
.most-played-year {
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  text-align: center;
}

.most-played-year h2 {
  font-size: 32px;
  color: #ffd700;
  margin: 0 0 20px 0;
}

.most-played-details {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.year-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: 'Bungee';
}

.year-stat .year {
  font-size: 28px;
  color: white;
}

.year-stat .count {
  font-size: 22px;
  color: #ffd700;
}

.game-entry {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
}

.game-entry h3 {
  font-size: 28px;
  color: #ffd700;
  margin: 0 0 20px 0;
}

.game-entry h3 .date-value {
  color: #fff;
}

.game-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.game-detail {
  font-size: 28px;
  color: #ffd700;
  font-family: 'Bungee';
}

.game-detail .detail-value,
.game-detail .owner-name {
  color: #fff;
}

.player-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.player-entry {
  font-size: 22px;
  color: white;
  padding: 10px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
} 