/* Shared identity rules used by maps, map leaderboards, global leaderboards and profiles. */
.map-club-tag,
.player-profile-club-tag {
  box-sizing: border-box;
  overflow: visible;
  text-decoration: none;
}

/* $W widens the painted text without widening its layout box. */
.map-club-tag:has(.tm-text-wide),
.player-profile-club-tag:has(.tm-text-wide) {
  padding-inline-end: 12px;
}

/* Never underline one part of an identity while the other pages do not. */
.map-overview-person a,
.map-podium-player a,
.player-cell a,
.leaderboard-podium-card a,
.global-leaderboard-row a,
.maps-overview-record-holder a,
.player-profile-identity a,
.player-profile-flag a,
.unified-player-profile-link,
.unified-country-filter-link,
.unified-club-filter-link {
  color: inherit;
  text-decoration: none;
}

.map-overview-person a:hover,
.map-podium-player a:hover,
.player-cell a:hover,
.leaderboard-podium-card a:hover,
.global-leaderboard-row a:hover,
.maps-overview-record-holder a:hover,
.player-profile-identity a:hover,
.player-profile-flag a:hover,
.unified-player-profile-link:hover,
.unified-country-filter-link:hover,
.unified-club-filter-link:hover {
  text-decoration: none;
}

.map-club-tag:hover,
.player-profile-club-tag:hover {
  border-color: rgba(255,255,255,.32);
}

/* Keep g, j, p, q and y inside every visible name box. */
.map-podium-player .map-podium-identity-top .map-player-name,
.map-podium-player .map-player-primary .map-player-name,
.player-cell .map-table-identity-copy .map-player-name,
.player-cell .map-player-primary .map-player-name,
.leaderboard-podium-card .map-player-name,
.global-leaderboard-row .map-player-name,
.maps-overview-record-holder-name {
  top: 0;
  box-sizing: border-box;
  padding-top: 1px;
  padding-bottom: 3px;
  line-height: 1;
}

.map-podium-player .map-podium-identity-top .map-player-identity,
.map-podium-player .map-player-primary,
.player-cell .map-table-identity-copy > .map-player-identity,
.player-cell .map-player-primary,
.leaderboard-podium-card .map-player-identity,
.global-leaderboard-row .map-player-identity {
  overflow: visible;
}

/* Player profile uses the same linked flag/club behavior as all leaderboard identities. */
.player-profile-flag a {
  display: block;
  width: 100%;
  height: 100%;
}

.player-profile-flag a:focus-visible,
.player-profile-club-tag:focus-visible {
  outline: 2px solid var(--salmon);
  outline-offset: 2px;
}

.player-profile-club-tag.map-club-tag {
  color: inherit;
}

/* Local map contexts are informative but still open the global leaderboard selector. */
.season-controls.is-context-display .season-dropdown-toggle {
  color: #9b9294;
  background: #121011;
  border-color: rgba(255,255,255,.09);
}

.season-controls.is-context-display .season-dropdown-current,
.season-controls.is-context-display .season-dropdown-chevron {
  color: #8b8284;
}

.season-controls.is-context-display .season-dropdown-toggle:hover,
.season-controls.is-context-display .season-dropdown.is-open .season-dropdown-toggle,
.season-controls.is-context-display .season-dropdown-toggle:focus-visible {
  color: var(--ink);
  border-color: rgba(255,255,255,.22);
}

.season-controls.is-context-display .season-dropdown-option.is-current {
  cursor: pointer;
  pointer-events: auto;
}

/* Shared removable search chip for map.php and leaderboard.php. */
.unified-active-search-filter {
  appearance: none;
  display: inline-flex;
  min-height: 30px;
  max-width: min(100%, 520px);
  padding: 0 9px;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  cursor: pointer;
  font: 700 11px/1 Inter, Arial, sans-serif;
}

.unified-active-search-filter > span:first-child {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-active-search-filter > i {
  flex: 0 0 auto;
  color: var(--salmon);
  font: 800 16px/1 Inter, Arial, sans-serif;
  font-style: normal;
}

.unified-active-search-filter:hover,
.unified-active-search-filter:focus-visible {
  border-color: rgba(239,51,79,.55);
  background: rgba(239,51,79,.08);
  outline: 0;
}

/* Separate flag links keep the exact dimensions previously applied to a direct image. */
.unified-player-flag-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: stretch;
  overflow: visible;
  line-height: 0;
  text-decoration: none;
}

.unified-player-flag-link > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-overview-person .map-player-fit-content > .unified-player-flag-link,
.map-overview-person > .unified-player-flag-link {
  width: 42px;
  height: 28px;
}

.map-podium-player .map-podium-identity-top > .unified-player-flag-link,
.map-podium-player .map-player-fit-content > .unified-player-flag-link,
.map-podium-player > .unified-player-flag-link {
  width: 57px;
  height: 38px;
  flex-basis: 57px;
}

.player-cell .map-table-fit-content > .unified-player-flag-link,
.player-cell .map-player-fit-content > .unified-player-flag-link,
.player-cell > .unified-player-flag-link {
  width: 72px;
  height: 48px;
  flex-basis: 72px;
}

.unified-player-identity {
  color: inherit;
}

.unified-player-profile-link.map-player-name,
.unified-club-filter-link.map-club-tag {
  color: inherit;
}

.unified-country-filter-link:focus-visible,
.unified-club-filter-link:focus-visible,
.unified-player-profile-link:focus-visible {
  outline: 2px solid var(--salmon);
  outline-offset: 2px;
}
