@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: #5a215a;
  color: #ffffff;
}

.leaderboard-container {
  min-height: 100vh;
  padding: 24px;
  background-color: #5a215a;
}

@media (min-width: 600px) {
  .leaderboard-container {
    padding: 32px;
  }
}

.content-wrapper {
  width: 708px;
  max-width: 100%;
  margin: 0 auto;
}

/* Header */
.leaderboard-header h1 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 24px;
}

@media (min-width: 600px) {
  .leaderboard-header h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 40px;
  }
}

/* Stats Section */
.stats-section {
  display: flex;
  flex-direction: row;
  margin-bottom: 16px;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 600px) {
  .stats-section {
    margin-bottom: 40px;
  }
}

.stat-card {
  color: #1a1a1a;
  background-color: #5a215a;
  border-radius: 5px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  justify-content: center;
}

@media (min-width: 600px) {
  .stat-card {
    padding: 24px 32px;
  }
}

.stat-card h2 {
  font-weight: 600;
  font-size: 32px;
  margin: 0;
}

@media (min-width: 600px) {
  .stat-card h2 {
    font-size: 45px;
    font-weight: 700;
  }
}

.stat-card span {
  margin-top: -4px;
  font-size: 14px;
  text-align: center;
}

@media (min-width: 600px) {
  .stat-card span {
    font-size: 20px;
  }
}

/* Chart Container */
.chart-container {
  width: 100%;
  display: grid;
  gap: 8px 8px;
  grid-template-columns: auto auto 1fr;
  align-items: center;
}

@media (min-width: 600px) {
  .chart-container {
    gap: 8px 16px;
  }
}

.bar-label {
  font-weight: 600;
  font-size: 20px;
  text-align: left;
}

@media (min-width: 600px) {
  .bar-label {
    font-size: 24px;
    font-weight: 700;
  }
}

.percentage-value {
  font-size: 20px;
  text-align: left;
}

@media (min-width: 600px) {
  .percentage-value {
    font-size: 24px;
    font-weight: 500;
  }
}

.bar-container {
  height: 14px;
  background-color: #ffffff;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.bar {
  height: 100%;
  background-color: #5a215a;
  border-radius: 7px;
  transition: width 1s ease-out;
}

/* Players Section */
.player-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-row {
  display: flex;
  flex-direction: column;
  color: #ffffff;
  align-items: space-between;
  font-size: 16px;
}

@media (min-width: 600px) {
  .player-row {
    font-size: 24px;
  }
}

.player-row.current-player {
  color: #5a215a;
}

.player-details {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
}

@media (min-width: 600px) {
  .player-details {
    gap: 24px;
  }
}

.player-details > *:last-child {
  margin-left: auto;
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.rank {
  font-weight: 700;
  font-size: 1em;
}

.player-name {
  font-weight: 600;
}

.player-score {
  font-weight: 500;
  text-align: right;
  color: #f3ac3d;
}

.divider {
  border: none;
  background-color: #ffffff;
  width: 100%;
  height: 1px;
  opacity: 0.3;
  margin: 32px 0;
}

/* Tab Switcher */
.tab-switcher {
  display: flex;
  margin-bottom: 32px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.tab-button {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.7;
}

@media (min-width: 600px) {
  .tab-button {
    font-size: 18px;
    padding: 16px 32px;
  }
}

.tab-button:hover {
  opacity: 0.9;
  background-color: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
  background-color: #ffffff;
  color: #5a215a;
  opacity: 1;
  font-weight: 700;
}