.statistics-hero {
  padding-bottom: 30px
}

.statistics-snapshot-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px
}

.statistics-snapshot-note img {
  flex: 0 0 auto;
  opacity: .82
}

.statistics-page {
  padding-bottom: 76px
}

.statistics-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(21, 16, 18, .9)
}

.statistics-tab {
  flex: 1 0 auto;
  min-width: 126px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 800 15px 'Barlow Condensed';
  letter-spacing: .08em;
  text-transform: uppercase
}

.statistics-tab:hover,
.statistics-tab:focus-visible {
  color: var(--ink);
  border-color: rgba(255, 128, 104, .35)
}

.statistics-tab.is-active {
  color: var(--ink);
  border-color: rgba(239, 51, 79, .65);
  background: rgba(239, 51, 79, .14)
}

.statistics-panel[hidden] {
  display: none
}

.statistics-panel {
  min-height: 280px
}

.statistics-panel-placeholder,
.statistics-panel-error {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
  text-align: center
}

.statistics-panel-placeholder p,
.statistics-panel-error p {
  margin: 0
}

.statistics-panel-error strong {
  color: var(--ink);
  font: 800 26px 'Barlow Condensed';
  text-transform: uppercase
}

.statistics-loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, .12);
  border-top-color: var(--salmon);
  border-radius: 50%;
  animation: statistics-spin .8s linear infinite
}

@keyframes statistics-spin {
  to {
    transform: rotate(360deg)
  }
}

.statistics-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel)
}

.statistics-overview-stat {
  min-width: 0;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.statistics-overview-stat:nth-child(5n) {
  border-right: 0
}

.statistics-overview-stat:nth-last-child(-n+5) {
  border-bottom: 0
}

.statistics-overview-stat strong,
.statistics-overview-stat span {
  display: block
}

.statistics-overview-stat strong {
  overflow: hidden;
  color: var(--cream);
  font: 900 clamp(34px, 3.2vw, 48px) 'Barlow Condensed';
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap
}

.statistics-overview-stat span {
  max-width: 190px;
  margin-top: 10px;
  color: var(--muted);
  font: 700 13px/1.25 'Barlow Condensed';
  letter-spacing: .075em;
  text-transform: uppercase
}

.statistics-overview-charts,
.statistics-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px
}

.statistics-overview-charts {
  grid-template-columns: minmax(500px, 550px) minmax(0, 1fr);
  gap: 32px
}

.statistics-map-chart-grid {
  display: grid;
  gap: 20px
}

.statistics-secondary-card-grid,
.statistics-table-card-spaced {
  margin-top: 20px
}

.statistics-chart-card,
.statistics-card,
.statistics-table-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(29, 20, 22, .98), rgba(21, 16, 18, .98))
}

.statistics-chart-card,
.statistics-card,
.statistics-table-card {
  padding: 28px
}

.statistics-chart-card .section-heading,
.statistics-card .section-heading,
.statistics-table-card .section-heading {
  margin-bottom: 22px
}

.statistics-chart-card .section-heading h2,
.statistics-card .section-heading h2,
.statistics-table-card .section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(29px, 2.8vw, 38px);
  line-height: .98
}

.statistics-chart-card .section-heading .eyebrow,
.statistics-card .section-heading .eyebrow,
.statistics-table-card .section-heading .eyebrow {
  font-size: 12px
}

.statistics-donut-layout {
  display: grid;
  grid-template-columns: 210px minmax(210px, 1fr);
  align-items: center;
  gap: 28px
}

.statistics-donut {
  position: relative;
  width: min(100%, 210px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--statistics-donut)
}

.statistics-donut::after {
  content: '';
  position: absolute;
  inset: 22%;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #171113
}

.statistics-donut > span {
  position: absolute;
  z-index: 1;
  inset: 27%;
  display: grid;
  place-content: center;
  text-align: center
}

.statistics-donut strong,
.statistics-donut small {
  display: block
}

.statistics-donut strong {
  color: var(--cream);
  font: 900 clamp(30px, 4vw, 45px) 'Barlow Condensed';
  line-height: 1
}

.statistics-donut small {
  margin-top: 4px;
  color: var(--muted);
  font: 700 12px 'Barlow Condensed';
  letter-spacing: .08em;
  text-transform: uppercase
}

.statistics-donut-legend {
  display: grid;
  gap: 12px
}

.statistics-donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px
}

.statistics-donut-legend-row i {
  width: 11px;
  height: 11px;
  background: var(--chart-color)
}

.statistics-donut-legend-row span {
  min-width: 86px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap
}

.statistics-donut-legend-row strong {
  color: var(--cream);
  font: 800 17px 'Barlow Condensed'
}

.statistics-donut-legend-row small {
  min-width: 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: right
}

.statistics-completion-card {
  min-width: 0;
  overflow-x: auto;
  padding-left: 36px
}

.statistics-completion-summary {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 14px
}

.statistics-completion-summary strong {
  color: var(--cream);
  font: 800 18px 'Barlow Condensed'
}

.statistics-completion-histogram {
  min-width: 720px;
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(10, minmax(48px, 1fr));
  align-items: end;
  gap: 12px;
  margin-left: 18px;
  padding: 18px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  background-image: linear-gradient(to top, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 25%
}

.statistics-completion-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 24px 200px 34px;
  align-items: end;
  text-align: center
}

.statistics-completion-value {
  align-self: center;
  color: var(--cream);
  font: 800 15px 'Barlow Condensed'
}

.statistics-completion-bar {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center
}

.statistics-completion-bar i {
  width: min(100%, 54px);
  height: var(--completion-height);
  min-height: 3px;
  background: linear-gradient(180deg, var(--salmon), var(--red))
}

.statistics-completion-column.is-complete .statistics-completion-bar i {
  background: #63b56c
}

.statistics-completion-column small {
  align-self: start;
  margin-top: 9px;
  color: var(--muted);
  font: 700 12px/1.15 'Barlow Condensed';
  white-space: nowrap
}

.statistics-event-identity {
  min-width: 0;
  display: grid;
  gap: 8px
}

.statistics-event-identity .statistics-player-identity {
  padding-left: 0
}

.statistics-chart-list {
  display: grid;
  gap: 18px
}

.statistics-chart-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px
}

.statistics-chart-row-head span {
  color: var(--ink);
  font: 700 15px Inter, Arial, sans-serif
}

.statistics-chart-row-head strong {
  color: var(--cream);
  font: 800 19px 'Barlow Condensed'
}

.statistics-chart-row-head small {
  min-width: 48px;
  color: var(--muted);
  font-size: 12px;
  text-align: right
}

.statistics-chart-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .055)
}

.statistics-chart-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--salmon))
}

.statistics-ranking-chart-list {
  display: grid
}

.statistics-ranking-chart-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 12px 0;
  border-top: 1px solid rgba(60, 40, 43, .78)
}

.statistics-ranking-chart-row:first-child {
  border-top: 0
}

.statistics-ranking-chart-copy {
  min-width: 0
}

.statistics-ranking-chart-copy .statistics-chart-track {
  height: 8px;
  margin-top: 10px
}

.statistics-ranking-chart-value {
  min-width: 68px;
  color: var(--cream);
  font: 800 22px 'Barlow Condensed';
  text-align: right;
  white-space: nowrap
}

.statistics-paired-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px
}

.statistics-paired-chart-group {
  min-width: 0
}

.statistics-paired-chart-group h3 {
  margin: 0 0 14px;
  color: var(--salmon);
  font: 800 20px 'Barlow Condensed';
  letter-spacing: .05em;
  text-transform: uppercase
}

.statistics-paired-chart-list {
  display: grid;
  gap: 17px
}

.statistics-paired-list {
  display: grid
}

.statistics-paired-list-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(60, 40, 43, .78)
}

.statistics-paired-list-row:first-child {
  border-top: 0
}

.statistics-paired-list-identity {
  min-width: 0
}

.statistics-paired-list-row > strong {
  color: var(--cream);
  font: 800 20px 'Barlow Condensed';
  text-align: right;
  white-space: nowrap
}

.statistics-paired-chart-row {
  min-width: 0
}

.statistics-paired-chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 9px
}

.statistics-paired-chart-head > strong {
  color: var(--cream);
  font: 800 18px 'Barlow Condensed';
  text-align: right;
  white-space: nowrap
}

.statistics-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px
}

.statistics-ranking-list {
  display: grid
}

.statistics-ranking-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 11px 0;
  border-top: 1px solid rgba(60, 40, 43, .78)
}

.statistics-ranking-row:first-child {
  border-top: 0
}

.statistics-ranking-position {
  color: var(--salmon);
  font: 800 16px 'Barlow Condensed'
}

.statistics-ranking-identity {
  min-width: 0
}

.statistics-ranking-metric {
  min-width: 108px;
  max-width: 240px;
  text-align: right
}

.statistics-ranking-metric strong,
.statistics-ranking-metric small {
  display: block
}

.statistics-ranking-metric strong {
  color: var(--cream);
  font: 800 22px 'Barlow Condensed';
  line-height: 1.1;
  white-space: nowrap
}

.statistics-ranking-metric strong span {
  color: var(--muted);
  font-size: .7em
}

.statistics-ranking-metric small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3
}

.statistics-activity-breakdown {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap
}

.statistics-activity-breakdown span {
  display: block
}

.statistics-player-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px
}

.statistics-player-flag {
  flex: 0 0 auto;
  width: 31px;
  height: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 2px
}

.statistics-player-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.statistics-player-copy {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px
}

.statistics-player-copy .map-club-tag {
  flex: 0 0 auto;
  font-size: 15px
}

.statistics-player-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 700 16px Inter, Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap
}

.statistics-player-name:hover,
.statistics-player-name:focus-visible,
.statistics-player-copy .map-club-tag:hover,
.statistics-player-copy .map-club-tag:focus-visible {
  color: var(--salmon)
}

.statistics-map-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 7px
}

.statistics-map-primary {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 9px
}

.statistics-season-badge {
  flex: 0 0 auto;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.statistics-map-main {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 9px
}

.statistics-map-main b {
  flex: 0 0 auto;
  color: var(--salmon);
  font: 800 15px 'Barlow Condensed'
}

.statistics-map-main a {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 700 16px Inter, Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap
}

.statistics-map-main a:hover,
.statistics-map-main a:focus-visible {
  color: var(--salmon)
}

.statistics-map-holder {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px
}

.statistics-map-holder > small {
  flex: 0 0 auto;
  color: var(--muted);
  font: 800 11px 'Barlow Condensed';
  letter-spacing: .08em
}

.statistics-map-holder .statistics-player-name,
.statistics-map-holder .statistics-player-copy .map-club-tag {
  font-size: 13px
}

.statistics-map-holder .statistics-player-flag {
  width: 23px;
  height: 17px
}

.statistics-event-map,
.statistics-event-player {
  min-width: 0
}

.statistics-event-player {
  margin-top: 8px
}

.statistics-event-player .statistics-player-name {
  font-size: 15px
}

.statistics-event-player .statistics-player-copy .map-club-tag {
  font-size: 14px
}

.statistics-event-player .statistics-player-flag {
  width: 27px;
  height: 19px
}

.statistics-empty {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px
}

.statistics-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse
}

.statistics-table th,
.statistics-table td {
  padding: 15px 15px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap
}

.statistics-table td {
  font-size: 14px
}

.statistics-table th {
  color: var(--muted);
  font: 700 12px 'Barlow Condensed';
  letter-spacing: .09em;
  text-transform: uppercase
}

.statistics-country-table th button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit
}

.statistics-country-table th button:hover,
.statistics-country-table th button:focus-visible,
.statistics-country-table th[aria-sort='ascending'] button,
.statistics-country-table th[aria-sort='descending'] button {
  color: var(--cream)
}

.statistics-country-table th[aria-sort='ascending'] button::after {
  content: '▲';
  font-size: 9px
}

.statistics-country-table th[aria-sort='descending'] button::after {
  content: '▼';
  font-size: 9px
}

.statistics-table th:first-child,
.statistics-table th:nth-child(2),
.statistics-table td:first-child,
.statistics-table td:nth-child(2) {
  text-align: left
}

.statistics-table tbody tr:hover {
  background: rgba(255, 128, 104, .045)
}

.statistics-country-identity {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700
}

.statistics-country-identity img {
  flex: 0 0 auto;
  width: 32px;
  height: 22px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 2px
}

.statistics-country-identity:hover,
.statistics-country-identity:focus-visible {
  color: var(--salmon)
}

.statistics-show-all {
  margin-top: 20px
}

.statistics-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(255, 128, 104, .35);
  background: rgba(255, 128, 104, .08);
  color: var(--cream);
  font: 700 12px 'Barlow Condensed';
  letter-spacing: .06em;
  text-transform: uppercase
}

@media(max-width:1180px) {
  .statistics-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .statistics-overview-stat:nth-child(5n) {
    border-right: 1px solid var(--line)
  }

  .statistics-overview-stat:nth-child(2n) {
    border-right: 0
  }

  .statistics-overview-stat:nth-last-child(-n+5) {
    border-bottom: 1px solid var(--line)
  }

  .statistics-overview-stat:nth-last-child(-n+2) {
    border-bottom: 0
  }

  .statistics-overview-charts {
    grid-template-columns: minmax(460px, .95fr) minmax(0, 1.3fr)
  }
}

@media(max-width:920px) {
  .statistics-completion-card {
    padding-left: 28px
  }

  .statistics-completion-histogram {
    margin-left: 0
  }

  .statistics-card-grid,
  .statistics-chart-grid,
  .statistics-overview-charts,
  .statistics-paired-chart-grid {
    grid-template-columns: 1fr
  }

  .statistics-ranking-metric {
    max-width: 200px
  }
}

@media(max-width:640px) {
  .statistics-completion-card {
    padding-left: 20px
  }

  .statistics-page {
    width: min(100% - 24px, var(--max))
  }

  .statistics-tabs {
    margin-inline: -2px
  }

  .statistics-tab {
    min-width: 108px;
    padding-inline: 15px
  }

  .statistics-overview-stat {
    min-height: 105px;
    padding: 21px 15px
  }

  .statistics-overview-stat strong {
    font-size: 32px
  }

  .statistics-overview-stat span {
    font-size: 12px
  }

  .statistics-chart-card,
  .statistics-card,
  .statistics-table-card {
    padding: 20px
  }

  .statistics-donut-layout {
    grid-template-columns: 1fr;
    gap: 22px
  }

  .statistics-donut {
    max-width: 190px
  }

  .statistics-ranking-row,
  .statistics-ranking-chart-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px
  }

  .statistics-ranking-metric,
  .statistics-ranking-chart-value {
    grid-column: 2;
    min-width: 0;
    max-width: none;
    margin-top: -3px;
    text-align: left
  }

  .statistics-ranking-metric strong,
  .statistics-ranking-metric small {
    display: inline
  }

  .statistics-ranking-metric small {
    margin-left: 8px
  }

  .statistics-player-flag {
    width: 27px;
    height: 19px
  }

  .statistics-player-copy .map-club-tag {
    font-size: 13px
  }

  .statistics-player-name,
  .statistics-map-main a {
    font-size: 14px
  }

  .statistics-season-badge {
    max-width: 82px
  }

  .statistics-paired-chart-head {
    grid-template-columns: 1fr;
    gap: 7px
  }

  .statistics-paired-list-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px
  }

  .statistics-paired-list-row > strong {
    grid-column: 2;
    text-align: left
  }

  .statistics-paired-chart-head > strong {
    text-align: left
  }

  .statistics-map-primary {
    align-items: flex-start
  }
}

/* Statistics card headers: show repeated metric units once per card. */
.statistics-ranking-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px
}

.statistics-ranking-heading-copy {
  min-width: 0
}

.statistics-card-metric-label {
  align-self: end;
  padding-bottom: 3px;
  color: var(--muted);
  font: 800 13px 'Barlow Condensed';
  letter-spacing: .09em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap
}

/* Keep the map name and its season together; player identity stays below. */
.statistics-map-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 14px
}

.statistics-map-main {
  min-width: 0
}

.statistics-season-badge {
  justify-self: end
}

/* Separate difficulty stars from the percentage instead of compressing them. */
.statistics-difficulty-metric {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 142px;
  gap: 16px;
  white-space: nowrap
}

.statistics-difficulty-stars {
  color: var(--salmon);
  letter-spacing: .04em
}

.statistics-difficulty-percent {
  min-width: 52px;
  color: var(--cream);
  text-align: right
}

@media (max-width: 760px) {
  .statistics-ranking-heading {
    gap: 12px
  }

  .statistics-card-metric-label {
    font-size: 12px
  }

  .statistics-map-primary {
    gap: 10px
  }

  .statistics-season-badge {
    max-width: 96px
  }
}

/* Keep activity rows on one shared two-line grid: map/season above, player below. */
.statistics-ranking-row-event {
  grid-template-columns: 38px minmax(0, 1fr) 170px;
  align-items: start
}

.statistics-ranking-row-event .statistics-ranking-position {
  padding-top: 2px
}

.statistics-ranking-row-event .statistics-ranking-metric {
  width: 170px;
  min-width: 170px;
  max-width: 170px
}

.statistics-ranking-row-event .statistics-event-identity {
  width: 100%;
  gap: 7px
}

.statistics-ranking-row-event .statistics-event-map,
.statistics-ranking-row-event .statistics-event-player,
.statistics-ranking-row-event .statistics-map-identity,
.statistics-ranking-row-event .statistics-map-primary {
  width: 100%
}

.statistics-ranking-row-event .statistics-event-player {
  margin-top: 0
}

.statistics-ranking-row-event .statistics-ranking-metric small {
  white-space: nowrap
}

/* Completion and author-rate pairs use a complete heading for each half. */
.statistics-paired-group-heading {
  margin-bottom: 14px
}

@media(max-width:640px) {
  .statistics-ranking-row-event {
    grid-template-columns: 30px minmax(0, 1fr)
  }

  .statistics-ranking-row-event .statistics-ranking-metric {
    width: auto;
    min-width: 0;
    max-width: none
  }

  .statistics-ranking-row-event .statistics-ranking-metric small {
    white-space: normal
  }
}
