.stats-outline {
  width: 1115px;
}

.stats-filters {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}

.stats-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 3px 4px;
  background: rgb(56, 0, 79);
  border-radius: 6px;
}

.stats-tab {
  min-width: 128px;
  height: 34px;
  padding: 0px 14px;
  background: transparent;
  border-width: medium;
  border-style: none;
  border-color: currentcolor;
  border-image: none;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.stats-tab:hover {
  color: var(--color-lime-primary);
}

.stats-tab:focus-visible {
  outline: 2px solid var(--color-pink-primary);
  outline-offset: 2px;
}

.stats-tab.active {
  background: var(--color-lime-primary);
  color: rgb(56, 0, 79);
}

.stats-spotlight {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 350px;
  margin: 0px 0px 20px;
  /* Team background image — set by JS via --spotlight-bg-image */
  background: var(--spotlight-bg-image, url("../assets/stats/stats-spotlight-bg.jpg")) left center / cover no-repeat var(--spotlight-team-color, rgb(6, 53, 35));
  border-radius: 12px;
  overflow: hidden;
  transition: background-color 0.45s ease;
}

.stats-spotlight[hidden] {
  display: none;
}

.stats-spotlight-player {
  align-self: flex-end;
  flex: 0 0 auto;
  width: auto;
  max-width: 28%;
  height: 100%;
  max-height: 100%;
  margin: 0px 40px 0px 28px;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  pointer-events: none;
}

.stats-spotlight-panel {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0px;
  padding: 0px 24px 0px 28px;
  /* Left border uses the team accent colour */
  border-left: 2px solid var(--spotlight-accent, rgb(242, 213, 134));
  /* Dark overlay fades from team brand colour at left to transparent at right */
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--spotlight-team-color, rgb(6, 53, 35)) 95%, black) 0%,
      transparent 100%);
  transition: border-color 0.45s ease, background 0.45s ease;
}

.stats-spotlight-panel::before,
.stats-spotlight-panel::after {
  content: "";
  position: absolute;
  left: 0px;
  right: 0px;
  height: 1px;
  background: linear-gradient(90deg,
      var(--spotlight-accent, rgb(242, 213, 134)) 0%,
      rgba(140, 123, 78, 0) 100%);
  transition: background 0.45s ease;
}

.stats-spotlight-panel::before {
  top: 0px;
}

.stats-spotlight-panel::after {
  bottom: 0px;
}

.stats-spotlight-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}

.stats-spotlight-logo[hidden] {
  display: none;
}

.stats-spotlight-team-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 2px;
}

.stats-spotlight-team,
.stats-spotlight-name {
  margin: 0px;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  color: rgb(255, 255, 255);
  text-transform: uppercase;
}

.stats-spotlight-team {
  font-size: 28px;
  letter-spacing: 0.3px;
}

.stats-spotlight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0px;
  padding: 5px 12px;
  /* Tag uses the team accent colour as its background */
  background: var(--spotlight-accent, rgb(242, 213, 134));
  border-radius: 6px;
  /* Text on accent: if accent is light, we want dark text; use mix-blend-mode via opacity trick */
  color: var(--spotlight-team-color, rgb(7, 53, 36));
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.45s ease, color 0.45s ease;
}

.stats-spotlight-tag img {
  width: 16px;
  height: 16px;
  fill: black;
}

.stats-spotlight-rank {
  position: absolute;
  top: 24px;
  right: 16px;
  font-size: 14px;
  /* Rank badge also uses the accent colour */
  background: var(--spotlight-accent, rgb(242, 213, 134)) !important;
  color: var(--spotlight-team-color, rgb(7, 53, 36)) !important;
  transition: background 0.45s ease, color 0.45s ease;
}

.stats-spotlight-name {
  font-size: 46px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.stats-spotlight-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0px;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.stats-spotlight-value strong {
  font-size: 72px;
  font-weight: 700;
  /* Stat number uses the team accent colour */
  color: var(--spotlight-accent, rgb(242, 213, 134));
  line-height: 1;
  transition: color 0.45s ease;
}

.stats-spotlight-value span {
  font-size: 26px;
  color: rgb(255, 255, 255);
  opacity: 0.9;
}

.stats-table .belts-lb-col-player {
  width: 26%;
}

.stats-table[data-category="fielding"] .belts-lb-col-player {
  width: 33%;
}

.stats-section-page .belts-lb-footer {
  display: flex;
  justify-content: space-between;
}

.role-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  vertical-align: middle;

  background-color: var(--spotlight-team-color);

  -webkit-mask-image: var(--role-icon-url);
  mask-image: var(--role-icon-url);

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-size: contain;
  mask-size: contain;
}

@media (max-width: 1200px) {
  .stats-spotlight-player {
    max-width: 26%;
    margin-right: 28px;
    margin-left: 20px;
  }
}

@media (max-width: 1024px) {
  .stats-spotlight {
    height: 270px;
  }

  .stats-spotlight-player {
    max-width: 26%;
    margin-right: 20px;
    margin-left: 14px;
  }

  .stats-spotlight-panel {
    margin: 14px 0px;
    padding: 0px 18px 0px 22px;
  }

  .stats-spotlight-logo {
    width: 68px;
    height: 68px;
    margin-bottom: 6px;
  }

  .stats-spotlight-team {
    font-size: 22px;
  }

  .stats-spotlight-name {
    font-size: 32px;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .stats-spotlight-value strong {
    font-size: 60px;
  }

  .stats-spotlight-value span {
    font-size: 21px;
  }

  .stats-spotlight-tag {
    padding: 4px 11px;
    font-size: 12.5px;
  }

  .stats-spotlight-rank {
    top: 22px;
    right: 14px;
    font-size: 13.5px;
    padding: 4px 11px;
  }
}

@media (max-width: 768px) {
  .stats-filters {
    margin-bottom: 20px;
  }

  .stats-tabs {
    width: 100%;
  }

  .stats-tab {
    flex: 1 1 0px;
    min-width: 0px;
    padding: 0px 6px;
    font-size: 16px;
  }

  .stats-spotlight {
    height: 200px;
    border-radius: 10px;
  }

  .stats-spotlight-player {
    max-width: 34%;
    margin-right: 14px;
    margin-left: 10px;
  }

  .stats-spotlight-panel {
    margin: 10px 0px;
    padding: 0px 10px 0px 14px;
    gap: 0px;
  }

  .stats-spotlight-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
  }

  .stats-spotlight-team-row {
    gap: 4px 8px;
  }

  .stats-spotlight-team {
    font-size: 16px;
  }

  .stats-spotlight-tag {
    padding: 3px 9px;
    font-size: 14px;
    border-radius: 5px;
  }

  .stats-spotlight-tag img {
    width: 11px;
    height: 12px;
  }

  .stats-spotlight-name {
    font-size: 30px;
    margin-top: 3px;
    margin-bottom: 5px;
  }

  .stats-spotlight-value {
    gap: 7px;
  }

  .stats-spotlight-value strong {
    font-size: 42px;
  }

  .stats-spotlight-value span {
    font-size: 18px;
  }

  .stats-spotlight-rank {
    top: 18px;
    right: 10px;
    font-size: 12.5px;
    padding: 3px 9px;
  }
}

@media (max-width: 480px) {
  .stats-spotlight {
    height: 170px;
    border-radius: 8px;
  }

  .stats-spotlight-player {
    max-width: 36%;
    margin-right: 10px;
    margin-left: 6px;
  }

  .stats-spotlight-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 3px;
  }

  .stats-spotlight-team {
    font-size: 14px;
  }

  .stats-spotlight-name {
    font-size: 18px;
    margin-top: 2px;
    margin-bottom: 4px;
  }

  .stats-spotlight-value strong {
    font-size: 34px;
  }

  .stats-spotlight-value span {
    font-size: 13px;
  }

  .stats-spotlight-tag {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .stats-spotlight-rank {
    font-size: 10px;
    padding: 3px 8px;
    top: 7px;
    right: 7px;
  }
}

@media (max-width: 360px) {
  .stats-tab {
    font-size: 14px;
  }

  .stats-spotlight {
    height: 148px;
  }

  .stats-spotlight-player {
    max-width: 38%;
    margin-right: 8px;
    margin-left: 4px;
  }

  .stats-spotlight-logo {
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
  }

  .stats-spotlight-team {
    font-size: 13px;
  }

  .stats-spotlight-name {
    font-size: 16px;
    margin-top: 2px;
    margin-bottom: 3px;
  }

  .stats-spotlight-value strong {
    font-size: 28px;
  }

  .stats-spotlight-value span {
    font-size: 12px;
  }
}