
.ai-leaderboard-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #f3f5ef;
}

.ai-leaderboard-screen .character-screen-header {
  flex: 0 0 auto;
  padding: clamp(8px, 1.5vh, 16px) clamp(10px, 2vw, 24px);
}

.ai-leaderboard-content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0 clamp(10px, 2vw, 24px) 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ai-leaderboard-subtitle {
  margin: 0 0 16px;
  color: #aeb9a2;
  font-size: 12px;
  line-height: 1.7;
}

.ai-leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.ai-leaderboard-summary-card {
  display: grid;
  gap: 9px;
  padding: 17px;
  border: 1px solid rgba(183, 255, 114, 0.18);
  border-radius: 9px;
  background: rgba(183, 255, 114, 0.045);
}

.ai-leaderboard-summary-card span {
  color: #9ba791;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.ai-leaderboard-summary-card strong {
  overflow-wrap: anywhere;
  color: #b7ff72;
  font-size: clamp(17px, 3vw, 25px);
  font-weight: 950;
}

.ai-leaderboard-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(10, 14, 10, 0.5);
}

.ai-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.ai-leaderboard-table th {
  padding: 13px 12px;
  color: #8f9b83;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ai-leaderboard-table td {
  padding: 15px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 750;
  white-space: nowrap;
}

.ai-leaderboard-table tbody tr.is-player {
  background: rgba(183, 255, 114, 0.07);
}

.ai-leaderboard-rank {
  color: #a7b19d;
  font-variant-numeric: tabular-nums;
}

.ai-leaderboard-racer {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ai-leaderboard-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.ai-leaderboard-points {
  color: #b7ff72;
  font-weight: 950 !important;
}

.ai-leaderboard-history-title {
  margin: 22px 0 13px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.ai-leaderboard-history {
  display: grid;
  gap: 9px;
}

.ai-leaderboard-race {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.ai-leaderboard-race-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.ai-leaderboard-race-info strong {
  color: #b7ff72;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.ai-leaderboard-race-info span {
  color: #89947e;
  font-size: 10px;
}

.ai-leaderboard-race-results {
  margin: 10px 0 0;
  color: #c6cebd;
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.ai-leaderboard-empty {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #aeb9a2;
  font-size: 12px;
  line-height: 1.8;
}

@media (max-width: 520px) {
  .ai-leaderboard-table {
    font-size: 11px;
  }

  .ai-leaderboard-table th,
  .ai-leaderboard-table td {
    padding: 12px 9px;
  }

  .ai-leaderboard-table th {
    font-size: 8px;
  }

  .ai-leaderboard-race-results {
    font-size: 10px;
  }
}
