.stats-html,
.stats-body {
  display: block;
  min-height: 100vh;
  height: auto;
  width: 100%;
}

.stats-page {
  width: min(1120px, 94vw);
  margin: clamp(82px, 12vw, 140px) auto clamp(58px, 9vw, 112px);
  color: #f5f7ff;
}

.stats-hero,
.profile-hero {
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 34px);
  margin-bottom: clamp(20px, 4vw, 32px);
}

.stats-logo {
  width: clamp(92px, 18vw, 170px);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(2, 12, 24, 0.45));
}

.stats-hero-copy,
.profile-hero-copy {
  text-align: left;
}

.stats-hero h1,
.profile-hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.04;
}

.stats-hero p,
.profile-hero p {
  max-width: 720px;
  margin: 0;
  padding: 0;
  color: #dbe5f7;
  line-height: 1.7;
  font-size: clamp(16px, 2.2vw, 20px);
}

.stats-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(143, 220, 255, 0.34);
  background: rgba(12, 24, 44, 0.5);
  color: #9fd7ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-panel {
  background: rgba(9, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: clamp(18px, 4vw, 30px);
  margin: clamp(16px, 3vw, 24px) 0;
  box-shadow: 0 20px 44px rgba(2, 6, 12, 0.55);
  backdrop-filter: blur(6px);
}

.stats-panel h1,
.stats-panel h2 {
  margin: 0 0 12px;
}

.stats-panel h2 {
  color: #ffd700;
  font-size: clamp(22px, 4vw, 34px);
}

.stats-panel p {
  margin: 0;
  padding: 0;
  color: #dbe5f7;
  line-height: 1.7;
}

.stats-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stats-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.stats-form label {
  font-weight: 700;
  color: #f5f7ff;
}

.stats-form select,
.stats-form input {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(143, 220, 255, 0.35);
  border-radius: 12px;
  background: rgba(12, 24, 44, 0.74);
  color: #f5f7ff;
  font: inherit;
  padding: 12px 13px;
  outline: none;
}

.stats-form button,
.stats-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 215, 0, 0.62);
  border-radius: 12px;
  background: linear-gradient(135deg, #fddc6c, #ffd700);
  color: #081829;
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}

.stats-inline-link {
  margin-top: 16px;
  width: fit-content;
}

.stats-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stats-section-heading h2 {
  margin: 0;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 52px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 20, 36, 0.55);
}

.leaderboard-avatar,
.profile-result-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: rgba(143, 220, 255, 0.12);
  box-shadow: 0 8px 18px rgba(2, 6, 12, 0.38);
}

.profile-result-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.leaderboard-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(143, 220, 255, 0.16);
  color: #9fd7ff;
  font-weight: 700;
}

.leaderboard-player,
.profile-result-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f5f7ff;
  font-weight: 700;
}

.leaderboard-value,
.profile-stat-value,
.profile-summary-card strong {
  color: #ffd700;
  font-weight: 700;
}

.profile-result-grid,
.profile-summary-grid,
.profile-stat-grid {
  display: grid;
  gap: 14px;
}

.profile-result-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-result,
.profile-summary-card,
.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 20, 36, 0.55);
}

.profile-result {
  flex-direction: row;
  align-items: center;
}

.profile-result-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-result-meta,
.profile-summary-card small,
.profile-stat-rank,
.profile-stat-name {
  color: #dbe5f7;
}

.profile-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(16px, 3vw, 24px) 0;
}

.profile-summary-card span,
.profile-stat-name {
  font-size: 0.92rem;
}

.profile-summary-card strong,
.profile-stat-value {
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.15;
}

.profile-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  image-rendering: pixelated;
  box-shadow: 0 16px 30px rgba(2, 6, 12, 0.5);
}

.stats-body .playercount {
  display: flex;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 840px) {
  .stats-controls,
  .profile-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-form {
    grid-template-columns: 1fr;
  }

  .stats-form button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .stats-hero,
  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-row {
    grid-template-columns: 44px 42px minmax(0, 1fr);
  }

  .leaderboard-value {
    grid-column: 3;
  }

  .stats-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
