:root {
  --bg: #080b10;
  --surface: #0d131b;
  --surface-2: #111923;
  --surface-3: #151f2b;
  --line: #293441;
  --line-soft: #1c2530;
  --text: #f5f7fa;
  --muted: #8d98a8;
  --red: #ee1715;
  --red-dark: #a90d0d;
  --gold: #e2aa24;
  --silver: #9ba8b1;
  --bronze: #ad5a2c;
  --ease: cubic-bezier(.22,.8,.24,1);
  --radius: 14px;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -14%, rgba(238,23,21,.075), transparent 32%),
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.018), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 74px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,11,16,.94);
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  width: min(1440px, calc(100% - 40px));
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: 48px;
  color: white;
  text-decoration: none;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.55px;
}

.brand strong { color: var(--red); }

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 11px rgba(238,23,21,.18));
  transition: transform .2s var(--ease), filter .2s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-3deg) scale(1.04);
  filter: drop-shadow(0 0 15px rgba(238,23,21,.28));
}

.main-nav {
  align-self: stretch;
  display: flex;
}

.nav-link {
  position: relative;
  min-width: 148px;
  padding: 0 25px;
  border: 0;
  background: transparent;
  color: #abb3be;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.nav-link.active {
  color: white;
  background: rgba(255,255,255,.022);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 2px;
  background: linear-gradient(90deg, #a80d0d, #f32926, #a80d0d);
  box-shadow: 0 0 13px rgba(238,23,21,.35);
}

.nav-icon,
.nav-icon svg { width: 18px; height: 18px; }

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 11px;
}

.action-button {
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s var(--ease), border-color .16s ease, box-shadow .16s ease;
}

.action-button:hover {
  transform: translateY(-2px);
  border-color: #3a4656;
  box-shadow: 0 9px 22px rgba(0,0,0,.22);
}

.action-button-red {
  border-color: #ca1513;
  background: linear-gradient(180deg, #e11a17, #a90d0d);
}

.action-button svg { width: 17px; height: 17px; }
.discord-icon { width: 19px; height: 15px; }

.mobile-menu {
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  display: none;
  place-items: center;
  cursor: pointer;
}

.mobile-menu svg { width: 20px; height: 20px; }

.mobile-panel {
  position: fixed;
  inset: 74px 0 auto;
  z-index: 45;
  padding: 10px 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #0a0f15;
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}

.mobile-action {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.mobile-action-red {
  background: linear-gradient(180deg, #d91816, #a90d0d);
}

main {
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 68px;
}

.mode-shell {
  padding: 10px;
  border: 1px solid #252f3a;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% -25%, rgba(238,23,21,.045), transparent 38%),
    #0c1219;
  box-shadow: 0 18px 48px rgba(0,0,0,.15);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(102px, 1fr));
  gap: 9px;
}

.mode-button {
  position: relative;
  min-height: 86px;
  border: 1px solid #293441;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 70%),
    #111821;
  color: #a7b0bc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .17s var(--ease), border-color .17s ease, background .17s ease, box-shadow .17s ease;
}

.mode-button::after {
  content: "";
  position: absolute;
  inset: auto 15px 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

.mode-button:hover {
  transform: translateY(-2px);
  border-color: #3c4858;
}

.mode-button.active {
  transform: translateY(-1px);
  border-color: rgba(238,23,21,.68);
  color: white;
  background:
    radial-gradient(circle at 50% 28%, rgba(238,23,21,.16), transparent 62%),
    #12151a;
  box-shadow: 0 13px 29px rgba(0,0,0,.22);
}

.mode-button.active::after {
  background: var(--red);
  box-shadow: 0 0 11px rgba(238,23,21,.52);
}

.mode-icon {
  width: 36px;
  height: 36px;
  border: 1px solid #344052;
  border-radius: 9px;
  background: #0a1017;
  display: grid;
  place-items: center;
  color: #cbd3dd;
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
}

.mode-icon svg { width: 24px; height: 24px; }
.tier-icon-image {
  width: 72%;
  height: 72%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.mode-button.active .mode-icon {
  border-color: rgba(238,23,21,.52);
  color: #ff4946;
  background: rgba(117,11,13,.24);
}

.mode-name {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.search-bar {
  position: relative;
  margin: 15px 0 13px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 21px;
  height: 21px;
  color: #7d8897;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color .16s ease;
}

.search-icon svg { width: 21px; height: 21px; }

.search-bar:focus-within .search-icon { color: var(--red); }

#search {
  width: 100%;
  height: 58px;
  padding: 0 76px 0 55px;
  border: 1px solid #293441;
  border-radius: 12px;
  outline: none;
  background: #101720;
  color: white;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

#search:focus {
  border-color: rgba(238,23,21,.78);
  background: #121a24;
  box-shadow: 0 0 0 3px rgba(238,23,21,.10), 0 14px 34px rgba(0,0,0,.18);
}

#search::placeholder { color: #747f8e; }

.search-bar kbd {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 7px;
  border: 1px solid #303b49;
  border-bottom-color: #202936;
  border-radius: 6px;
  background: #0c1219;
  color: #6f7b8b;
  font-size: 10px;
}

.search-suggestions {
  position: absolute;
  inset: calc(100% + 7px) 0 auto;
  z-index: 30;
  display: none;
  max-height: min(360px, 52vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #101720;
  box-shadow: 0 22px 55px rgba(0,0,0,.38);
  overscroll-behavior: contain;
}

.search-suggestions.show { display: block; }

.search-suggestion {
  width: 100%;
  min-height: 54px;
  padding: 7px 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.search-suggestion:first-child { border-top: 0; }
.search-suggestion:hover,
.search-suggestion.active { background: #18222e; }

.search-suggestion-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid #344052;
  border-radius: 7px;
  image-rendering: pixelated;
}

.search-suggestion strong {
  color: white;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 15px;
}

.search-suggestion-flag {
  width: 28px;
  height: 19px;
  margin-left: auto;
  border-radius: 5px;
  object-fit: cover;
}

.search-suggestion-rank {
  padding: 4px 7px;
  border: 1px solid #303b49;
  border-radius: 999px;
  color: #909baa;
  background: #0c1219;
  font-size: 10px;
}

.tier-divider-section,
.ranking-card {
  border: 1px solid #293441;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(0,0,0,.16);
}

.tier-divider-section {
  margin-bottom: 14px;
  overflow: hidden;
}

.tier-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 9px;
  padding: 10px;
  overflow-x: auto;
}

.tier-column {
  min-width: 185px;
  overflow: hidden;
  border: 1px solid #293441;
  border-radius: 11px;
  background: #101821;
}

.tier-column-title {
  height: 47px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.tier-column-trophy {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.24));
}

.tier-column-trophy svg {
  width: 19px;
  height: 19px;
  display: block;
}

.tier-column[data-tier="1"] .tier-column-title { color: #f0b857; background: #41361b; }
.tier-column[data-tier="2"] .tier-column-title { color: #a9b1b9; background: #343843; }
.tier-column[data-tier="3"] .tier-column-title { color: #d59161; background: #352620; }
.tier-column[data-tier="4"] .tier-column-title { color: #b1c0cc; background: #161e2a; }
.tier-column[data-tier="5"] .tier-column-title { color: #b1c0cc; background: #161e2a; }

.tier-player-row {
  min-height: 42px;
  padding: 5px 9px;
  border-top: 1px solid #1a2430;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.tier-player-row.high {
  background: linear-gradient(90deg, rgba(181, 199, 216, .14), #172230 72%);
}
.tier-player-row.low { background: linear-gradient(90deg, rgba(84,103,170,.10), #172230 72%); }

.tier-player-row:hover {
  transform: translateX(2px);
  background-color: #1b2939;
}

.tier-mini-avatar {
  width: 29px;
  height: 29px;
  border: 1px solid #3a4657;
  border-radius: 7px;
  image-rendering: pixelated;
}

.tier-mini-name {
  min-width: 0;
  overflow: hidden;
  color: white;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-mini-code {
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid #354052;
  border-radius: 6px;
  color: #b6bfca;
  background: #0c1219;
  font-size: 9px;
  font-weight: 900;
}

.tier-mini-division {
  width: 25px;
  height: 25px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #dce5ef;
}

.tier-mini-division.high {
  color: #f4c94f;
  border-color: rgba(244, 201, 79, .5);
  background: rgba(244, 201, 79, .12);
}

.tier-mini-division.low {
  color: #8fa8c9;
  border-color: rgba(143, 168, 201, .45);
  background: rgba(143, 168, 201, .10);
}

.tier-mini-division img {
  width: 16px;
  height: 16px;
  display: block;
}

.ranking-card { overflow: hidden; }

.loading-state {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8e99a8;
  font-size: 13px;
}

.loading-spinner {
  width: 19px;
  height: 19px;
  border: 2px solid #303b49;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ranking-skeleton {
  width: min(92%, 920px);
  display: grid;
  gap: 11px;
}

.skeleton-row {
  min-height: 56px;
  padding: 9px 14px;
  border: 1px solid #1e2a38;
  border-radius: 9px;
  background: #111a24;
  display: grid;
  grid-template-columns: 52px minmax(120px, 1fr) 28%;
  align-items: center;
  gap: 12px;
}

.skeleton-row span {
  height: 15px;
  border-radius: 5px;
  background: linear-gradient(90deg, #1b2735 20%, #29384a 42%, #1b2735 64%);
  background-size: 240% 100%;
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.skeleton-row span:first-child {
  width: 30px;
}

.skeleton-row span:last-child {
  justify-self: end;
  width: 82%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

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

.table-scroll {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #394554 #0b1016;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

thead th {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #0b1016;
  color: #798494;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.05px;
  text-align: left;
  text-transform: uppercase;
}

thead th:first-child,
tbody td:first-child {
  width: 105px;
  text-align: center;
}

thead th:last-child,
tbody td:last-child { text-align: right; }

tbody tr {
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s var(--ease);
}

tbody tr:first-child { border-top: 0; }

tbody tr:hover {
  transform: translateX(2px);
  box-shadow: none;
  background: linear-gradient(90deg, rgba(255,255,255,.045), rgba(255,255,255,.016) 40%, transparent);
}

body:not([data-mode="Overall"]) tbody tr.high-tier-row {
  background: linear-gradient(90deg, rgba(122,23,31,.22), transparent 62%);
}

body:not([data-mode="Overall"]) tbody tr.low-tier-row {
  background: linear-gradient(90deg, rgba(39,48,84,.25), transparent 62%);
}

tbody td {
  height: 71px;
  padding: 0 16px;
}

.rank-number {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  color: #bfc6d0;
  font-size: 16px;
  font-weight: 850;
}

.rank-number.top {
  width: 58px;
  height: 38px;
  min-width: 58px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 9px;
  align-items: center;
  color: white;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 700;
  text-shadow: 0 2px 3px rgba(0,0,0,.46);
  box-shadow: 0 7px 18px rgba(0,0,0,.23);
}

.rank-number.first { background: linear-gradient(135deg, #9b6809, #dca51f 58%, #efc143); }
.rank-number.second { background: linear-gradient(135deg, #65737d, #929fa8 58%, #b7c1c7); }
.rank-number.third { background: linear-gradient(135deg, #733716, #a45629 58%, #c77742); }

.player-cell {
  min-width: 825px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-main {
  width: 262px;
  flex: 0 0 262px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  overflow: hidden;
  border: 1px solid #344052;
  border-radius: 9px;
  background: #121a24;
  image-rendering: pixelated;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #dce2e9;
  background: #151e29;
  font-size: 11px;
  font-weight: 900;
}

/* Top 3 colors: gold, silver and bronze. */
tbody tr.top td {
  position: relative;
}

tbody tr.top td::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--top-color);
  box-shadow: 0 0 14px var(--top-glow);
  opacity: .88;
  pointer-events: none;
}

tbody tr.top.first { --top-color: #f4c94f; --top-glow: rgba(244, 201, 79, .7); }
tbody tr.top.second { --top-color: #cbd4dc; --top-glow: rgba(203, 212, 220, .62); }
tbody tr.top.third { --top-color: #c77b48; --top-glow: rgba(199, 123, 72, .62); }

tbody tr.top .avatar {
  border-color: var(--top-color);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--top-color) 24%, transparent),
    0 0 17px var(--top-glow);
}

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

.player-name {
  min-width: 0;
  max-width: 176px;
  overflow: hidden;
  color: #f5f7fa;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-name.name-lg { font-size: 16.5px; }
.player-name.name-xl { font-size: 14.5px; letter-spacing: 0; }

.country-badge {
  width: 32px;
  height: 25px;
  padding: 0;
  border: 1px solid #344052;
  border-radius: 8px;
  background: #101720;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 0 0 auto;
}

.country-flag-image {
  width: 28px;
  height: 19px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

.player-mobile-country {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.player-tier-list {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tier-item {
  --division: #7f8a98;
  --division-text: #dce2e8;
  position: relative;
  height: 36px;
  min-width: 67px;
  padding: 0 8px 0 5px;
  border: 1px solid color-mix(in srgb, var(--division) 33%, #28323e);
  border-radius: 9px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 8%, transparent), transparent 72%),
    #111821;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
}

.tier-item::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--division);
}

.tier-item.selected {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--division) 66%, #ee1715);
  box-shadow: 0 7px 16px rgba(0,0,0,.14);
}

.tier-symbol {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid color-mix(in srgb, var(--division) 30%, #344052);
  border-radius: 7px;
  background: #090f15;
  display: grid;
  place-items: center;
  color: var(--division);
}

.tier-symbol svg { width: 17px; height: 17px; }

.tier-code {
  color: var(--division-text);
  font-size: 11px;
  font-weight: 950;
}

.division-ht1 { --division: #6d5d2c; --division-text: #e8ba3a; }
.division-lt1 { --division: #584c25; --division-text: #d5b355; }
.division-ht2 { --division: #5e6979; --division-text: #c4d3e7; }
.division-lt2 { --division: #4a505a; --division-text: #a0a7b2; }
.division-ht3 { --division: #6b4b36; --division-text: #f89f5a; }
.division-lt3 { --division: #593722; --division-text: #c67b42; }
.division-ht4 { --division: #303144; --division-text: #81749a; }
.division-lt4 { --division: #2c2e40; --division-text: #655b79; }
.division-ht5 { --division: #2b2c3d; --division-text: #8f82a8; }
.division-lt5 { --division: #262a3a; --division-text: #655b79; }

.points {
  min-width: 94px;
  color: #f4f6f9;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.points small {
  margin-left: 4px;
  padding: 3px 6px;
  border: 1px solid #2c3744;
  border-radius: 999px;
  color: #8c98a7;
  background: #111923;
  font-family: Inter, sans-serif;
  font-size: 8px;
}

.empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 6px;
  color: #828e9d;
  text-align: center;
}

.empty strong { color: white; font-size: 16px; }

.empty-retry {
  justify-self: center;
  margin-top: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(238,23,21,.5);
  border-radius: 8px;
  background: rgba(238,23,21,.1);
  color: #ff7773;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  transition: transform .16s var(--ease), border-color .16s ease, background .16s ease;
}

.empty-retry:hover {
  transform: translateY(-1px);
  border-color: rgba(238,23,21,.8);
  background: rgba(238,23,21,.17);
}

.empty-retry:disabled {
  cursor: wait;
  opacity: .55;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(238,23,21,.08), transparent 36%),
    rgba(0,0,0,.74);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  transition: opacity .28s ease, visibility .28s ease;
}

.profile-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.profile-modal {
  position: relative;
  width: min(540px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid #303b49;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% -8%, var(--profile-glow, rgba(238,23,21,.11)), transparent 35%),
    linear-gradient(180deg, #111925, #0d141d);
  box-shadow: 0 34px 110px rgba(0,0,0,.62);
  transform: translateY(14px) scale(.982);
  will-change: transform, opacity;
  transition: transform .3s var(--ease), opacity .24s ease;
}

.profile-overlay.open .profile-modal { transform: translateY(0) scale(1); }

.profile-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #223047;
  color: #c9d3e1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.profile-close:hover { background: #351b22; color: #ff5a57; }
.profile-close svg { width: 22px; height: 22px; }

.profile-head {
  padding: 34px 30px 21px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  text-align: center;
}

.profile-avatar {
  position: relative;
  width: 142px;
  height: 142px;
  margin: 0 auto 14px;
  overflow: hidden;
  border: 6px solid #1b2940;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #2a3a52, #111923 74%);
  box-shadow: 0 18px 44px rgba(0,0,0,.30);
  image-rendering: pixelated;
}

.profile-avatar img {
  position: absolute;
  width: 166px;
  height: 218px;
  max-width: none;
  left: 50%;
  top: -4px;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
  image-rendering: pixelated;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: white;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 30px;
  font-weight: 700;
}

.profile-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.profile-name {
  max-width: min(340px, 70vw);
  margin: 0;
  overflow-wrap: anywhere;
  color: #f8fafc;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: .65px;
}

.profile-name-country {
  width: 38px;
  height: 30px;
  padding: 0 2px;
  border: 1px solid #394657;
  border-radius: 9px;
  background: #111923;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.profile-name-country img {
  width: 32px;
  height: 21px;
  border-radius: 5px;
  object-fit: cover;
}

.profile-role {
  width: max-content;
  margin: 16px auto 0;
  padding: 7px 13px;
  border: 1px solid rgba(238,23,21,.22);
  border-radius: 999px;
  color: #ff8a87;
  background: rgba(117,11,13,.24);
  font-size: 12px;
  font-weight: 800;
}

.profile-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #303d4e;
  border-radius: 8px;
  background: rgba(17,25,35,.84);
  color: #aeb9c8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  transition: transform .16s var(--ease), border-color .16s ease, color .16s ease, background .16s ease;
}

.profile-action:hover {
  transform: translateY(-1px);
  border-color: #53647a;
  color: #f5f7fa;
  background: #1a2635;
}

.profile-action svg {
  width: 14px;
  height: 14px;
}

.profile-body { padding: 18px 26px 30px; }

.profile-label {
  margin: 16px 0 8px;
  color: #8d99aa;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.55px;
}

.profile-position {
  min-height: 70px;
  padding: 8px 10px;
  border: 1px solid #303b4c;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(238,23,21,.075), transparent 52%), #151e29;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.profile-rank {
  min-width: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #c10f0d, #ee1715 58%, #94100f);
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 34px;
  font-style: italic;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(125,7,7,.24);
}

/* Top 3 keep their rank glow, but use the same square avatar shape as the rest. */
.ranking-card tbody tr.top .avatar {
  border-radius: 8px;
}

.profile-rank.profile-first { background: linear-gradient(135deg, #9b6809, #dca51f 58%, #efc143); }
.profile-rank.profile-second { background: linear-gradient(135deg, #65737d, #929fa8 58%, #b7c1c7); }
.profile-rank.profile-third { background: linear-gradient(135deg, #733716, #a45629 58%, #c77742); }

.profile-overall {
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 9px;
  background: #111923;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-overall-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f6f8fb;
  font-size: 15px;
  font-weight: 900;
}

.profile-overall-title svg { width: 18px; height: 18px; color: #f0bd43; }

.profile-points {
  padding: 6px 10px;
  border: 1px solid #334156;
  border-radius: 999px;
  color: #b6c8df;
  background: #0c1219;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.profile-tiers {
  padding: 11px;
  border: 1px solid #303b4c;
  border-radius: 12px;
  background: #121a24;
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
}

.profile-tier {
  --division: #7f8a98;
  --division-text: #dce2e8;
  position: relative;
  min-height: 98px;
  padding: 11px 6px 8px;
  border: 1px solid #303946;
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 5%, transparent), transparent 72%),
    #0f161f;
  display: grid;
  grid-template-rows: 37px 16px 21px;
  align-items: center;
  justify-items: center;
  gap: 3px;
  overflow: hidden;
}

.profile-tier::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--division);
}

.profile-tier-icon {
  width: 37px;
  height: 37px;
  border: 1px solid color-mix(in srgb, var(--division) 34%, #3a475c);
  border-radius: 9px;
  background: #090e14;
  display: grid;
  place-items: center;
  color: var(--division);
}

.profile-tier-icon svg { width: 22px; height: 22px; }

.profile-tier-mode {
  max-width: 100%;
  overflow: hidden;
  color: #929eae;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .65px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-tier-code {
  min-width: 42px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--division) 55%, transparent);
  border-radius: 6px;
  color: var(--division-text);
  background: color-mix(in srgb, var(--division) 23%, #0c1219);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 150;
  min-width: 210px;
  padding: 11px 14px;
  border: 1px solid #354153;
  border-radius: 10px;
  background: #111923;
  color: white;
  box-shadow: 0 16px 45px rgba(0,0,0,.38);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s var(--ease);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .mode-grid { grid-template-columns: repeat(4, 1fr); }
  .main-nav, .top-actions { display: none; }
  .mobile-menu { display: grid; }
}

@media (max-width: 760px) {
  .topbar-inner { width: calc(100% - 24px); }
  main { width: calc(100% - 20px); padding-top: 30px; }
  .brand { margin-right: 0; font-size: 20px; }
  .brand-logo { width: 40px; height: 40px; }
  .search-bar kbd { display: none; }
  #search { padding-right: 18px; }
  table { min-width: 1040px; }
  .player-cell { min-width: 770px; }
  .player-main { width: 230px; flex-basis: 230px; }
  .country-badge { width: 32px; padding: 0; justify-content: center; }
}

@media (max-width: 560px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .mode-shell { padding: 8px; }
  .mode-button { min-height: 78px; }
  .profile-overlay { align-items: flex-end; padding: 8px; }
  .profile-modal { width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px 18px 12px 12px; }
  .profile-avatar { width: 126px; height: 126px; }
  .profile-avatar img { width: 150px; height: 202px; top: -3px; }
  .profile-name-row {
    flex-wrap: wrap;
    gap: 7px;
  }
  .profile-name { max-width: 100%; }
  .profile-name-country { height: 31px; padding-right: 5px; }
  .profile-name-country img { width: 32px; height: 21px; }
  .profile-body { padding-inline: 17px; }
  .profile-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-position { grid-template-columns: 64px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Players without a Top 3 rank keep a calm card-like number badge. */
.rank-number:not(.top) {
  height: 48px;
  min-width: 58px;
  align-items: center;
  border: 1px solid #30445b;
  border-radius: 8px;
  color: #d3dce7;
  background:
    linear-gradient(145deg, rgba(111, 143, 181, .16), rgba(24, 39, 57, .42) 58%, rgba(12, 21, 33, .72)),
    #172435;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 5px 14px rgba(0,0,0,.16);
}

.profile-rank:not(.profile-first):not(.profile-second):not(.profile-third) {
  border: 1px solid #30445b;
  color: #d3dce7;
  background:
    linear-gradient(145deg, rgba(111, 143, 181, .16), rgba(24, 39, 57, .42) 58%, rgba(12, 21, 33, .72)),
    #172435;
}

/* Top 3 glint: a contained highlight that sweeps across the rank badge. */
.ranking-card .rank-number.top,
.profile-rank.profile-first,
.profile-rank.profile-second,
.profile-rank.profile-third {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.ranking-card .rank-number.top::after,
.profile-rank.profile-first::after,
.profile-rank.profile-second::after,
.profile-rank.profile-third::after {
  position: absolute;
  inset: -45% -62%;
  z-index: 2;
  background: linear-gradient(108deg, transparent 39%, rgba(255,255,255,.14) 46%, rgba(255,255,255,.96) 50%, rgba(255,255,255,.14) 54%, transparent 61%);
  content: "";
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-72%) skewX(-14deg);
  animation: rank-glint 3.2s cubic-bezier(.4,0,.2,1) infinite;
}

.ranking-card .rank-number.first::after,
.profile-rank.profile-first::after { animation-delay: 0s; }

.ranking-card .rank-number.second::after,
.profile-rank.profile-second::after { animation-delay: 0s; }

.ranking-card .rank-number.third::after,
.profile-rank.profile-third::after { animation-delay: 0s; }

@keyframes rank-glint {
  0%, 43% { opacity: 0; transform: translateX(-72%) skewX(-14deg); }
  51% { opacity: 1; }
  59% { opacity: .9; }
  70%, 100% { opacity: 0; transform: translateX(72%) skewX(-14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-card .rank-number.top::after,
  .profile-rank.profile-first::after,
  .profile-rank.profile-second::after,
  .profile-rank.profile-third::after {
    display: none;
  }
}


@media (max-width: 760px) {
  .rank-number:not(.top) {
    height: 42px;
    min-width: 48px;
    border-radius: 8px;
  }
}

/* Superfícies densas mantêm foco e movimento estáveis. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .profile-section-toggle {
    transition: color .18s ease, transform .18s var(--ease);
  }

  .profile-section-toggle:hover {
    transform: translateX(2px);
  }

  .profile-nick-actions {
    animation: nick-actions-in .18s cubic-bezier(.22,.8,.24,1) both;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes nick-actions-in {
    from {
      opacity: 0;
      transform: translateY(-4px) scale(.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* Camada final de polimento: microinterações sem custo constante de animação. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .nav-link {
    transition: color .18s ease, background-color .18s ease, transform .18s var(--ease);
  }

  .nav-link:hover {
    color: #f5f8fc;
    background: rgba(255,255,255,.038);
    transform: translateY(-1px);
  }

  .mode-button::before {
    content: "";
    position: absolute;
    inset: -45% -20%;
    z-index: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,.105), transparent 62%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .mode-button:hover::before {
    opacity: 1;
  }

  .mode-button > * {
    position: relative;
    z-index: 1;
  }

  .search-suggestion:hover {
    transform: translateX(3px);
  }

  .tier-player-row[data-player]:hover {
    box-shadow: inset 3px 0 0 rgba(238,23,21,.52);
  }

  tbody tr[data-player]:hover {
    box-shadow: inset 3px 0 0 rgba(238,23,21,.55);
  }
}

@media (min-width: 761px) {
  .tier-column {
    content-visibility: auto;
    contain-intrinsic-size: auto 430px;
  }
}

/* Mobile ranking layout: each player is a two-level card, preventing tier overlap. */
@media (max-width: 760px) {
  main {
    width: min(calc(100% - 20px), 680px);
    padding-top: 16px;
  }

  .mode-shell {
    padding: 6px;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mode-button {
    min-height: 82px;
    gap: 7px;
  }

  .mode-icon {
    width: 42px;
    height: 42px;
  }

  .mode-name {
    font-size: 11px;
  }

  .search-bar {
    margin: 14px 0;
  }

  #search {
    height: 56px;
  }

  .ranking-card {
    padding: 0 7px 9px;
    overflow: hidden;
  }

  .ranking-card .table-scroll,
  .ranking-card table {
    overflow: visible;
  }

  .ranking-card table {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .ranking-card thead,
  .ranking-card tbody,
  .ranking-card thead tr,
  .ranking-card tbody tr {
    display: block;
    width: 100%;
  }

  .ranking-card thead {
    padding: 4px 4px 6px;
  }

  .ranking-card thead tr {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 66px;
    grid-template-rows: 24px 22px;
    align-items: center;
  }

  .ranking-card thead th {
    display: block;
    width: auto !important;
    min-width: 0;
    height: auto !important;
    padding: 0 4px !important;
    border: 0 !important;
    background: transparent !important;
    color: #718096;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
  }

  .ranking-card thead th:nth-child(1) { grid-column: 1; grid-row: 1; }
  .ranking-card thead th:nth-child(2) { grid-column: 2; grid-row: 1; position: static; text-align: left; }
  .ranking-card thead th:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right; }
  .ranking-card thead th:nth-child(4) { display: none; }
  .ranking-card thead th:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    padding-right: 40px !important;
    text-align: left;
  }

  .ranking-card .ranking-info-button {
    top: -2px;
    right: 0;
  }

  .ranking-card tbody {
    display: grid;
    gap: 8px;
    padding: 0 2px;
  }

  .ranking-card tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 66px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px 7px;
    min-height: 0;
    padding: 11px 7px 10px;
    border: 1px solid #202d3d;
    border-radius: 11px;
    background: linear-gradient(90deg, rgba(255,255,255,.012), transparent 58%), #141d29;
    box-sizing: border-box;
    transition: transform .18s var(--ease), border-color .18s ease, background .18s ease;
  }

  .ranking-card tbody tr:hover {
    transform: translateY(-1px);
    background: #182332;
  }

  .ranking-card tbody tr.top {
    border-top: 2px solid var(--top-color);
  }

  .ranking-card tbody tr.top td::before {
    display: none;
  }

  .ranking-card tbody td {
    display: block;
    width: auto !important;
    min-width: 0;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
  }

  .ranking-card tbody td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .ranking-card tbody td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .ranking-card tbody td:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right; }
  .ranking-card tbody td:nth-child(4) { display: none; }
  .ranking-card tbody td:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 9px !important;
    border-top: 1px solid rgba(48, 65, 84, .72) !important;
  }

  .ranking-card .rank-number.top {
    width: 48px;
    height: 42px;
    min-width: 48px;
    border-radius: 8px;
    font-size: 25px;
  }

  .ranking-card .rank-number:not(.top) {
    min-width: 48px;
    font-size: 25px;
  }

  .ranking-card .player-cell,
  .ranking-card .player-main,
  .ranking-card .player-identity {
    width: 100%;
    min-width: 0;
  }

  .ranking-card .player-main {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ranking-card .avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 8px;
  }

  .ranking-card .player-name-line {
    width: 100%;
    min-width: 0;
    gap: 5px;
  }

  .ranking-card .player-name {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
  }

  .ranking-card .player-name.name-lg { font-size: 14px; }
  .ranking-card .player-name.name-xl { font-size: 12px; }

  .ranking-card .player-mobile-country {
    display: inline-flex;
    width: 30px;
    height: 21px;
    padding: 2px;
    border: 1px solid #3a4a5f;
    border-radius: 6px;
    background: #172235;
  }

  .ranking-card .player-mobile-country .country-flag-image {
    width: 25px;
    height: 16px;
    border-radius: 3px;
  }

  .ranking-card .player-ranking-title {
    max-width: 100%;
    margin-top: 3px;
    padding: 2px 5px;
    font-size: 8px;
    gap: 2px;
  }

  .ranking-card .player-ranking-title > span {
    font-size: 10px;
  }

  .ranking-card .points {
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
  }

  .ranking-card .points small {
    margin-left: 3px;
    font-size: 9px;
  }

  .ranking-card .player-tier-list {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 3px;
  }

  .ranking-card .tier-item {
    width: 100%;
    min-width: 0;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--division) 42%, #354153);
    border-radius: 9px;
    background: color-mix(in srgb, var(--division) 8%, #111923);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
  }

  .ranking-card .tier-item::after {
    display: none;
  }

  .ranking-card .tier-symbol {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border-radius: 7px;
  }

  .ranking-card .tier-symbol svg {
    width: 15px;
    height: 15px;
  }

  .ranking-card .tier-code {
    width: auto;
    font-size: 8px;
    line-height: 1;
  }

  .ranking-card .tier-item-unrated {
    filter: none;
    color: #8d97a3;
    background: #252d36;
  }

  .ranking-card .tier-item-unrated::before {
    display: none;
  }

  .ranking-card .tier-item-unrated .tier-symbol {
    opacity: .48;
    border-color: #4a545e;
    background: #2e353d;
  }
}

@media (max-width: 380px) {
  .ranking-card tbody tr {
    grid-template-columns: 50px minmax(0, 1fr) 61px;
    gap: 8px 5px;
    padding-inline: 5px;
  }

  .ranking-card thead tr {
    grid-template-columns: 50px minmax(0, 1fr) 61px;
  }

  .ranking-card .rank-number.top,
  .ranking-card .rank-number:not(.top) {
    min-width: 43px;
  }

  .ranking-card .rank-number.top {
    width: 43px;
    font-size: 23px;
  }

  .ranking-card .player-tier-list {
    gap: 2px;
  }

  .ranking-card .tier-item {
    height: 48px;
    min-height: 48px;
    border-radius: 8px;
    gap: 3px;
  }

  .ranking-card .tier-symbol {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .ranking-card .tier-symbol svg {
    width: 13px;
    height: 13px;
  }

  .ranking-card .tier-code {
    font-size: 7px;
  }
}

/* Stability fixes for profiles and mode layouts */
[hidden] {
  display: none !important;
}

.profile-overlay.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.ranking-card[hidden],
.tier-divider-section[hidden] {
  display: none !important;
}

.tier-player-row[data-player],
.search-suggestion[data-player],
tbody tr[data-player] {
  cursor: pointer;
}


/* Profile tiers: explicit category colors and rich hover details */
.profile-tier.division-ht1 { --division: #6d5d2c; --division-text: #e8ba3a; --division-bg: #41361b; }
.profile-tier.division-lt1 { --division: #584c25; --division-text: #d5b355; --division-bg: #584c25; }

.profile-tier.division-ht2 { --division: #5e6979; --division-text: #c4d3e7; --division-bg: #343843; }
.profile-tier.division-lt2 { --division: #4a505a; --division-text: #a0a7b2; --division-bg: #4a505a; }

.profile-tier.division-ht3 { --division: #6b4b36; --division-text: #f89f5a; --division-bg: #352620; }
.profile-tier.division-lt3 { --division: #593722; --division-text: #c67b42; --division-bg: #593722; }

.profile-tier.division-ht4 { --division: #303144; --division-text: #81749a; --division-bg: #303144; }
.profile-tier.division-lt4 { --division: #2c2e40; --division-text: #655b79; --division-bg: #2c2e40; }

.profile-tier.division-ht5 { --division: #2b2c3d; --division-text: #8f82a8; --division-bg: #2b2c3d; }
.profile-tier.division-lt5 { --division: #262a3a; --division-text: #655b79; --division-bg: #262a3a; }

.profile-tier {
  isolation: isolate;
  overflow: visible;
  border-color: color-mix(in srgb, var(--division) 42%, #303946);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 12%, transparent), transparent 68%),
    var(--division-bg, #0f161f);
  cursor: help;
  transition:
    transform .17s cubic-bezier(.22,.8,.24,1),
    border-color .17s ease,
    box-shadow .17s ease,
    background .17s ease;
}

.profile-tier::before {
  height: 3px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--division) 52%, transparent);
}

.profile-tier:hover,
.profile-tier:focus-visible {
  z-index: 8;
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--division) 72%, #ffffff);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 18%, transparent), transparent 70%),
    var(--division-bg, #111923);
  box-shadow:
    0 12px 25px rgba(0,0,0,.28),
    0 0 0 1px color-mix(in srgb, var(--division) 14%, transparent) inset;
}

.profile-tier-icon {
  color: var(--division) !important;
  border-color: color-mix(in srgb, var(--division) 54%, #3a475c);
  background:
    radial-gradient(circle at 38% 24%, rgba(255,255,255,.08), transparent 46%),
    color-mix(in srgb, var(--division-bg, #090e14) 72%, #090e14);
}

.profile-tier-code {
  color: var(--division-text) !important;
  border-color: color-mix(in srgb, var(--division) 65%, transparent);
  background: color-mix(in srgb, var(--division) 25%, #0c1219);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

.profile-tier-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 11px);
  z-index: 20;
  width: 190px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 7%, transparent), transparent 48%),
    #0c131b;
  color: #dfe5ec;
  box-shadow: 0 18px 42px rgba(0,0,0,.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 7px) scale(.97);
  transform-origin: center bottom;
  transition:
    opacity .15s ease,
    visibility .15s ease,
    transform .17s cubic-bezier(.22,.8,.24,1);
}

.profile-tier-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  border-right: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  border-bottom: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  background: #0c131b;
  transform: translate(-50%, -5px) rotate(45deg);
}

.profile-tier:hover .profile-tier-tooltip,
.profile-tier:focus-visible .profile-tier-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.tier-tooltip-heading,
.tier-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tier-tooltip-heading {
  padding-bottom: 8px;
  border-bottom: 1px solid #26313e;
  color: #98a4b4;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.tier-tooltip-heading strong {
  color: var(--division-text);
  font-size: 12px;
}

.tier-tooltip-row {
  margin-top: 8px;
  color: #96a2b1;
  font-size: 10px;
}

.tier-tooltip-row strong {
  color: #f3f6f9;
  font-size: 11px;
}

.tier-tooltip-peak-only,
.tier-tooltip-current {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  height: max-content;
  min-height: 0;
}

.tier-tooltip-label {
  color: #8d9aaa;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.tier-tooltip-peak-tier {
  color: var(--division-text);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 14px color-mix(in srgb, var(--division) 30%, transparent);
}

.tier-tooltip-current strong {
  color: var(--division-text);
  font-size: 16px;
}

.tier-tooltip-current > span:last-child {
  color: #c4ccd5;
  font-size: 10px;
}

.tier-tooltip-peak-points,
.tier-tooltip-empty {
  display: block;
  margin: 0;
  color: #b7c0cb;
  font-size: 10px;
  line-height: 1.15;
}

.profile-tiers {
  overflow: visible;
}

@media (max-width: 560px) {
  .profile-tier-tooltip {
    width: 168px;
  }

  .profile-tier:nth-child(odd) .profile-tier-tooltip {
    left: 0;
    transform: translate(0, 7px) scale(.97);
  }

  .profile-tier:nth-child(odd):hover .profile-tier-tooltip,
  .profile-tier:nth-child(odd):focus-visible .profile-tier-tooltip {
    transform: translate(0, 0) scale(1);
  }

  .profile-tier:nth-child(odd) .profile-tier-tooltip::after {
    left: 28px;
  }

  .profile-tier:nth-child(even) .profile-tier-tooltip {
    left: auto;
    right: 0;
    transform: translate(0, 7px) scale(.97);
  }

  .profile-tier:nth-child(even):hover .profile-tier-tooltip,
  .profile-tier:nth-child(even):focus-visible .profile-tier-tooltip {
    transform: translate(0, 0) scale(1);
  }

  .profile-tier:nth-child(even) .profile-tier-tooltip::after {
    left: auto;
    right: 20px;
  }
}

/* Keep the first tier row's tooltip inside the modal viewport. */
.profile-tier:nth-child(-n+4) .profile-tier-tooltip {
  top: calc(100% + 11px);
  bottom: auto;
  transform-origin: center top;
  transform: translate(-50%, -7px) scale(.97);
}

.profile-tier:nth-child(-n+4):hover .profile-tier-tooltip,
.profile-tier:nth-child(-n+4):focus-visible .profile-tier-tooltip {
  transform: translate(-50%, 0) scale(1);
}

.profile-tier:nth-child(-n+4) .profile-tier-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  border-right: 0;
  border-bottom: 0;
  transform: translate(-50%, 5px) rotate(45deg);
}

@media (max-width: 560px) {
  .profile-tier:nth-child(n+3) .profile-tier-tooltip {
    top: auto;
    bottom: calc(100% + 11px);
    transform-origin: center bottom;
    transform: translate(0, 7px) scale(.97);
  }

  .profile-tier:nth-child(n+3):hover .profile-tier-tooltip,
  .profile-tier:nth-child(n+3):focus-visible .profile-tier-tooltip {
    transform: translate(0, 0) scale(1);
  }

  .profile-tier:nth-child(n+3) .profile-tier-tooltip::after {
    top: 100%;
    bottom: auto;
    border-top: 0;
    border-right: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
    border-bottom: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
    transform: translate(0, -5px) rotate(45deg);
  }

  .profile-tier:nth-child(-n+2) .profile-tier-tooltip {
    top: calc(100% + 11px);
    bottom: auto;
    transform-origin: center top;
    transform: translate(0, -7px) scale(.97);
  }

  .profile-tier:nth-child(-n+2):hover .profile-tier-tooltip,
  .profile-tier:nth-child(-n+2):focus-visible .profile-tier-tooltip {
    transform: translate(0, 0) scale(1);
  }

  .profile-tier:nth-child(-n+2) .profile-tier-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
    border-right: 0;
    border-bottom: 0;
    transform: translate(0, 5px) rotate(45deg);
  }

  .profile-tier:nth-child(2) .profile-tier-tooltip {
    left: auto;
    right: 0;
  }

.profile-tier:nth-child(2) .profile-tier-tooltip::after {
    left: auto;
    right: 20px;
  }
}

/* Interaction polish: subtle motion and depth without affecting reduced-motion users. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes surface-rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mode-shell {
    animation: surface-rise .46s .05s cubic-bezier(.22,.8,.24,1) both;
  }

  .search-bar {
    animation: surface-rise .46s .1s cubic-bezier(.22,.8,.24,1) both;
    transition: transform .2s cubic-bezier(.22,.8,.24,1);
  }

  .search-bar:focus-within {
    transform: translateY(-1px);
  }

  .tier-divider-section:not([hidden]),
  .ranking-card:not([hidden]) {
    animation: surface-rise .34s cubic-bezier(.22,.8,.24,1) both;
  }

  .ranking-card,
  .tier-divider-section {
    transition: border-color .22s ease, box-shadow .22s ease;
  }

  .ranking-card:hover,
  .tier-divider-section:hover {
    border-color: #354455;
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
  }

  .mode-button:focus-visible,
  .search-suggestion:focus-visible,
  .mobile-action:focus-visible,
  .action-button:focus-visible,
  .profile-close:focus-visible {
    outline: 2px solid rgba(255, 92, 88, .9);
    outline-offset: 3px;
  }

  .mode-button.active .mode-icon {
    box-shadow: 0 0 0 1px rgba(238,23,21,.22), 0 7px 18px rgba(238,23,21,.16);
  }
}

/* Modes without a registered test are intentionally muted. */
.tier-item-unrated {
  --division: #707b87 !important;
  --division-text: #c0c6cc !important;
  border-color: #3d4854;
  background: #151b22;
  filter: grayscale(.9);
}

.tier-item-unrated::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(93, 103, 114, .34);
  pointer-events: none;
}

.tier-item-unrated > * {
  position: relative;
  z-index: 2;
  opacity: .68;
}

.profile-tier-unrated {
  --division: #707b87 !important;
  --division-text: #c0c6cc !important;
  --division-bg: #252b32 !important;
  filter: grayscale(.92);
}

.profile-tier-unrated::after {
  content: "NÃO TESTADO";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 6px;
  color: #d3d8dd;
  background: rgba(73, 81, 90, .68);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .7px;
  text-align: center;
  pointer-events: none;
}

.profile-tier-unrated:hover,
.profile-tier-unrated:focus-visible {
  filter: grayscale(.75);
}

/* Compact ranking rows and profiles: keep the primary views free of horizontal scrolling. */
.table-scroll {
  overflow-x: hidden;
}

table {
  min-width: 0;
  table-layout: fixed;
}

thead th:first-child,
tbody td:first-child {
  width: 84px;
}

thead th:last-child,
tbody td:last-child {
  width: 92px;
}

.player-cell {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.player-main {
  width: auto;
  min-width: 0;
  flex: none;
}

.player-tier-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.tier-item {
  min-width: 0;
  padding-inline: 3px;
  gap: 4px;
}

.tier-symbol {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

.tier-symbol svg {
  width: 15px;
  height: 15px;
}

.profile-modal {
  max-height: calc(100dvh - 20px);
  scrollbar-width: none;
}

.profile-modal::-webkit-scrollbar {
  display: none;
}

.profile-head {
  padding: 20px 24px 13px;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  margin-bottom: 9px;
  border-width: 4px;
}

.profile-avatar img {
  width: 124px;
  height: 166px;
  top: -3px;
}

.profile-name {
  font-size: clamp(25px, 6vw, 33px);
}

.profile-role {
  margin-top: 9px;
  padding: 5px 10px;
  font-size: 10px;
}

.profile-body {
  padding: 10px 18px 16px;
}

.profile-label {
  margin: 8px 0 5px;
}

.profile-position {
  min-height: 54px;
  padding: 6px 8px;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.profile-rank {
  font-size: 28px;
}

.profile-overall {
  padding-inline: 10px;
  gap: 8px;
}

.profile-overall-title {
  gap: 5px;
  font-size: 12px;
}

.profile-overall-title svg {
  width: 16px;
  height: 16px;
}

.profile-points {
  padding: 5px 8px;
  font-size: 10px;
}

.profile-tiers {
  padding: 7px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.profile-tier {
  min-height: 76px;
  padding: 8px 3px 6px;
  grid-template-rows: 27px 13px 18px;
  gap: 2px;
}

.profile-tier-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

.profile-tier-icon svg {
  width: 16px;
  height: 16px;
}

.profile-tier-mode {
  font-size: 8px;
  letter-spacing: .35px;
}

.profile-tier-code {
  min-width: 30px;
  padding: 3px 4px;
  font-size: 9px;
}

@media (max-width: 760px) {
  .table-scroll {
    overflow-x: hidden;
  }

  thead th,
  tbody td {
    padding-inline: 7px;
  }

  thead th:first-child,
  tbody td:first-child {
    width: 49px;
  }

  thead th:last-child,
  tbody td:last-child {
    width: 73px;
  }

  .player-cell {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .player-tier-list {
    width: 100%;
    gap: 3px;
  }

  .tier-item {
    height: 30px;
    padding-inline: 1px;
    gap: 2px;
  }

  .tier-symbol {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    border-radius: 5px;
  }

  .tier-symbol svg {
    width: 12px;
    height: 12px;
  }

  .tier-code {
    font-size: 8px;
  }

  .profile-head {
    padding: 15px 15px 10px;
  }

  .profile-avatar {
    width: 86px;
    height: 86px;
  }

  .profile-avatar img {
    width: 104px;
    height: 140px;
  }

  .profile-body {
    padding: 8px 12px 12px;
  }

  .profile-tiers {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
  }

  .profile-tier {
    min-height: 68px;
    padding-inline: 1px;
  }

  .profile-tier-mode {
    font-size: 7px;
    letter-spacing: 0;
  }

  .profile-tier-code {
    min-width: 0;
    padding-inline: 2px;
    font-size: 8px;
  }
}

/* Player progression titles. */
.profile-role {
  border-color: color-mix(in srgb, var(--title-color) 48%, #303b49);
  color: var(--title-color);
  background: color-mix(in srgb, var(--title-color) 14%, #111923);
  box-shadow: 0 0 18px color-mix(in srgb, var(--title-color) 13%, transparent);
}

.profile-title-none {
  --title-color: #9aa6b5;
}

.profile-title-cadete {
  --title-color: #72a9ff;
}

.profile-title-aprendiz {
  --title-color: #62d994;
}

.profile-title-especialista {
  --title-color: #be8cff;
}

.profile-title-profissional {
  --title-color: #ff9c5b;
}

.profile-title-mestre-do-combate {
  --title-color: #ffd34f;
  text-shadow: 0 0 12px rgba(255, 211, 79, .28);
}

.profile-modal.profile-first {
  --profile-glow: rgba(244, 201, 79, .16);
}

.profile-modal.profile-second {
  --profile-glow: rgba(203, 212, 220, .14);
}

.profile-modal.profile-third {
  --profile-glow: rgba(199, 123, 72, .15);
}

.profile-modal.profile-first .profile-avatar {
  border-color: #f4c94f;
  box-shadow:
    0 0 0 3px rgba(244, 201, 79, .2),
    0 0 26px rgba(244, 201, 79, .44),
    0 18px 44px rgba(0, 0, 0, .3);
}

.profile-modal.profile-second .profile-avatar {
  border-color: #cbd4dc;
  box-shadow:
    0 0 0 3px rgba(203, 212, 220, .18),
    0 0 26px rgba(203, 212, 220, .34),
    0 18px 44px rgba(0, 0, 0, .3);
}

.profile-modal.profile-third .profile-avatar {
  border-color: #c77b48;
  box-shadow:
    0 0 0 3px rgba(199, 123, 72, .2),
    0 0 26px rgba(199, 123, 72, .38),
    0 18px 44px rgba(0, 0, 0, .3);
}

/* Profile tier popovers stay above their card, matching the compact reference layout. */
#profileTiers .profile-tier .profile-tier-tooltip {
  top: auto;
  bottom: calc(100% + 10px);
  left: 50%;
  right: auto;
  z-index: 40;
  width: max-content;
  min-width: 0;
  max-width: min(140px, calc(100vw - 20px));
  box-sizing: border-box;
  padding: 7px 9px 8px;
  border-radius: 8px;
  transform: translate(-50%, 8px) scale(.96);
  transform-origin: center bottom;
}

#profileTiers .profile-tier:hover .profile-tier-tooltip,
#profileTiers .profile-tier:focus-visible .profile-tier-tooltip {
  transform: translate(-50%, 0) scale(1);
}

#profileTiers .profile-tier .profile-tier-tooltip::after {
  top: 100%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 0;
  border-right: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  border-bottom: 1px solid color-mix(in srgb, var(--division) 42%, #384454);
  transform: translate(-50%, -5px) rotate(45deg);
}

#profileTiers .profile-tier:nth-child(-n+3) .profile-tier-tooltip {
  left: 0;
  transform: translate(0, 8px) scale(.96);
  transform-origin: left bottom;
}

#profileTiers .profile-tier:nth-child(-n+3):hover .profile-tier-tooltip,
#profileTiers .profile-tier:nth-child(-n+3):focus-visible .profile-tier-tooltip {
  transform: translate(0, 0) scale(1);
}

#profileTiers .profile-tier:nth-child(-n+3) .profile-tier-tooltip::after {
  left: 28px;
  transform: translate(-50%, -5px) rotate(45deg);
}

#profileTiers .profile-tier:nth-child(n+5) .profile-tier-tooltip {
  right: 0;
  left: auto;
  transform: translate(0, 8px) scale(.96);
  transform-origin: right bottom;
}

#profileTiers .profile-tier:nth-child(n+5):hover .profile-tier-tooltip,
#profileTiers .profile-tier:nth-child(n+5):focus-visible .profile-tier-tooltip {
  transform: translate(0, 0) scale(1);
}

#profileTiers .profile-tier:nth-child(n+5) .profile-tier-tooltip::after {
  right: 28px;
  left: auto;
  transform: translate(50%, -5px) rotate(45deg);
}

.tier-tooltip-empty {
  color: #9da8b6;
}

#profileTiers .tier-tooltip-label {
  font-size: 9px;
  letter-spacing: .7px;
  white-space: nowrap;
}

#profileTiers .tier-tooltip-peak-tier {
  font-size: 20px;
}

#profileTiers .tier-tooltip-peak-points,
#profileTiers .tier-tooltip-current > span:last-child,
#profileTiers .tier-tooltip-empty {
  font-size: 10px;
  white-space: nowrap;
}

#profileTiers .tier-tooltip-peak-only,
#profileTiers .tier-tooltip-current {
  width: max-content;
  max-width: 100%;
}

/* The visible tooltip is rendered in a viewport layer to avoid modal overflow and stale offsets. */
#profileTiers .profile-tier .profile-tier-tooltip {
  display: none !important;
}

.profile-tooltip-layer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 220;
  width: max-content;
  max-width: min(140px, calc(100vw - 20px));
  padding: 7px 9px 8px;
  border: 1px solid color-mix(in srgb, var(--division, #9ba8b1) 42%, #384454);
  border-radius: 8px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division, #9ba8b1) 7%, transparent), transparent 48%),
    #0c131b;
  color: #dfe5ec;
  box-shadow: 0 18px 42px rgba(0,0,0,.48);
  will-change: transform, opacity;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.96);
  transform-origin: center bottom;
  transition: opacity .15s ease, visibility .15s ease, transform .17s var(--ease);
}

.profile-tooltip-layer.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.profile-tooltip-layer::after {
  position: absolute;
  top: 100%;
  left: var(--tooltip-arrow-left, 50%);
  width: 8px;
  height: 8px;
  border-right: 1px solid color-mix(in srgb, var(--division, #9ba8b1) 42%, #384454);
  border-bottom: 1px solid color-mix(in srgb, var(--division, #9ba8b1) 42%, #384454);
  background: #0c131b;
  content: "";
  transform: translate(-50%, -5px) rotate(45deg);
}

.profile-tooltip-layer[data-placement="bottom"] {
  transform-origin: center top;
  transform: translateY(-8px) scale(.96);
}

.profile-tooltip-layer[data-placement="bottom"].show {
  transform: translateY(0) scale(1);
}

.profile-tooltip-layer[data-placement="bottom"]::after {
  top: auto;
  bottom: 100%;
  border-top: 1px solid color-mix(in srgb, var(--division, #9ba8b1) 42%, #384454);
  border-right: 0;
  border-bottom: 0;
  transform: translate(-50%, 5px) rotate(45deg);
}

.profile-tooltip-layer .tier-tooltip-peak-only,
.profile-tooltip-layer .tier-tooltip-current {
  width: max-content;
  max-width: 100%;
}

.profile-tooltip-layer .tier-tooltip-label {
  white-space: nowrap;
}

.profile-tooltip-layer .tier-tooltip-peak-points,
.profile-tooltip-layer .tier-tooltip-current > span:last-child,
.profile-tooltip-layer .tier-tooltip-empty {
  white-space: nowrap;
}

.search-suggestion-loading {
  justify-content: center;
  color: #8e9bab;
  cursor: wait;
  font-size: 11px;
}

.ranking-sentinel {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 0.8rem;
  min-height: 44px;
  place-items: center;
  text-align: center;
}

.tier-columns-loading {
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px dashed #334050;
  border-radius: 12px;
  color: #8290a1;
  background: rgba(14, 20, 29, .72);
  font-size: 11px;
  letter-spacing: .02em;
}

.tier-columns-loading::before {
  width: 16px;
  height: 16px;
  margin-bottom: 7px;
  border: 2px solid #303b49;
  border-top-color: var(--red);
  border-radius: 50%;
  content: "";
  animation: spin .7s linear infinite;
}

.profile-last-test {
  margin: 7px 2px 0;
  color: #8290a1;
  font-size: 10px;
  text-align: right;
}

.profile-history {
  margin-top: 12px;
}

.profile-history-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.profile-history-heading .profile-label {
  margin: 16px 0 5px;
}

.profile-section-title {
  min-width: 0;
  flex: 1;
}

.profile-section-toggle {
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.profile-section-toggle:hover {
  color: #d8e1ec;
}

.profile-section-toggle:focus-visible {
  outline: 2px solid rgba(255, 92, 88, .9);
  outline-offset: 4px;
  border-radius: 4px;
}

.profile-section-chevron {
  width: 20px;
  height: 20px;
  border: 1px solid #3a4859;
  border-radius: 6px;
  color: #a9b5c4;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  transition: border-color .18s ease, color .18s ease;
}

.profile-section-chevron::before {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s var(--ease);
}

.profile-section-toggle:hover .profile-section-chevron {
  border-color: #687a90;
  color: #f3f6fa;
}

.profile-section-toggle[aria-expanded="true"] .profile-section-chevron {
  color: #f3f6fa;
}

.profile-section-toggle[aria-expanded="true"] .profile-section-chevron::before {
  transform: translateY(2px) rotate(225deg);
}

.profile-history-count {
  color: #718094;
  font-size: 9px;
  font-weight: 750;
}

.profile-history-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #303b4c;
  border-radius: 10px;
  background: #303b4c;
}

.profile-history-item {
  align-items: center;
  background: #121a24;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 32px;
  padding: 6px 9px;
}

.profile-history-mode {
  color: #c5ced9;
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-history-tier {
  color: #f2c94c;
  font-size: 11px;
  font-weight: 900;
}

.profile-history-item time {
  color: #778597;
  font-size: 9px;
  white-space: nowrap;
}

.profile-history-state {
  background: #121a24;
  color: #7f8c9d;
  font-size: 10px;
  padding: 10px;
  text-align: center;
}

/* Scroll surfaces stay visible, compact and consistent across browsers. */
html {
  scrollbar-width: thin;
  scrollbar-color: #394554 #0b1016;
}

html::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.tier-columns::-webkit-scrollbar,
.search-suggestions::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

html::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track,
.tier-columns::-webkit-scrollbar-track,
.search-suggestions::-webkit-scrollbar-track {
  background: #0b1016;
}

html::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.tier-columns::-webkit-scrollbar-thumb,
.search-suggestions::-webkit-scrollbar-thumb {
  border: 2px solid #0b1016;
  border-radius: 999px;
  background: #394554;
}

html::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover,
.tier-columns::-webkit-scrollbar-thumb:hover,
.search-suggestions::-webkit-scrollbar-thumb:hover {
  background: #586779;
}

.tier-columns {
  scrollbar-width: thin;
  scrollbar-color: #394554 #0b1016;
}

.search-suggestions {
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(.99);
  transition: opacity .16s ease, visibility .16s ease, transform .18s var(--ease);
}

.search-suggestions.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: no-preference) {
  .profile-overlay.open .profile-head {
    animation: surface-rise .32s cubic-bezier(.22,.8,.24,1) both;
  }

  .profile-overlay.open .profile-body {
    animation: surface-rise .34s .035s cubic-bezier(.22,.8,.24,1) both;
  }

  .tier-column {
    contain: layout paint;
    animation: surface-rise .3s calc(var(--column-index, 0) * 35ms) cubic-bezier(.22,.8,.24,1) both;
  }
}

.profile-name-trigger {
  max-width: 100%;
  padding: 2px 5px;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}

.profile-name-trigger:hover {
  color: #ffffff;
  background: rgba(255,255,255,.055);
}

.profile-name-trigger:focus-visible {
  outline: 2px solid rgba(255, 92, 88, .9);
  outline-offset: 3px;
}

.profile-nick-actions {
  width: max-content;
  max-width: 100%;
  margin: 9px auto 0;
  padding: 4px;
  border: 1px solid #303d4e;
  border-radius: 10px;
  background: rgba(12, 18, 27, .94);
  display: flex;
  gap: 4px;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}

.profile-nick-actions .profile-action {
  min-height: 27px;
  padding: 0 8px;
  border-color: transparent;
  border-radius: 7px;
  font-size: 9px;
}

.profile-nick-actions .profile-action:hover {
  transform: none;
  border-color: #3d4d61;
}

.profile-history-footer {
  margin-top: 5px;
  padding: 7px 9px;
  border: 1px solid #303b4c;
  border-radius: 8px;
  color: #8290a1;
  background: #0e151e;
  font-size: 9px;
  text-align: right;
}

.profile-avatar {
  width: 118px;
  height: 118px;
  margin-bottom: 11px;
}

.profile-avatar img {
  width: 140px;
  height: 188px;
}

.profile-name {
  font-size: clamp(28px, 6.5vw, 38px);
}

@media (max-width: 560px) {
  .profile-avatar {
    width: 98px;
    height: 98px;
  }

  .profile-avatar img {
    width: 118px;
    height: 158px;
  }

  .profile-name {
    font-size: clamp(27px, 8vw, 34px);
  }

  .profile-nick-actions {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile-first final pass: no horizontal ranking trap and a compact profile. */
@media (max-width: 760px) {
  button,
  a,
  input,
  [role="button"] {
    touch-action: manipulation;
  }

  .topbar {
    height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .topbar-inner {
    width: calc(100% - 20px);
    min-height: 64px;
  }

  .mobile-panel {
    top: calc(64px + env(safe-area-inset-top));
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .mobile-menu,
  .mobile-action {
    min-height: 44px;
  }

  main {
    width: min(100% - 16px, 680px);
    padding-top: 20px;
    padding-bottom: calc(42px + env(safe-area-inset-bottom));
  }

  .mode-shell {
    padding: 7px;
    border-radius: 12px;
  }

  .mode-button {
    min-height: 74px;
    border-radius: 9px;
  }

  .search-bar {
    margin: 12px 0;
  }

  #search {
    height: 52px;
    padding-left: 49px;
    border-radius: 10px;
  }

  .search-icon {
    left: 16px;
    width: 19px;
    height: 19px;
  }

  .search-icon svg {
    width: 19px;
    height: 19px;
  }

  .search-suggestions {
    max-height: min(320px, 55dvh);
    border-radius: 10px;
  }

  .tier-divider-section,
  .ranking-card {
    border-radius: 12px;
  }

  .tier-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
    overflow-x: visible;
  }

  .tier-column {
    min-width: 0;
    border-radius: 9px;
  }

  .tier-column-title {
    height: 39px;
    padding-inline: 6px;
    font-size: 15px;
  }

  .tier-column-trophy,
  .tier-column-trophy svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .tier-player-row {
    min-height: 39px;
    padding: 5px 7px;
    gap: 6px;
  }

  .tier-mini-avatar {
    width: 26px;
    height: 26px;
  }

  .tier-mini-name {
    font-size: 12px;
  }

  .ranking-sentinel {
    min-height: 42px;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 19px;
    gap: 8px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .profile-overlay {
    padding: 5px;
  }

  .profile-modal {
    max-height: calc(100dvh - 10px);
    border-radius: 16px 16px 10px 10px;
  }

  .profile-close {
    top: 9px;
    right: 9px;
    width: 36px;
    height: 36px;
  }

  .profile-head {
    padding: 13px 12px 9px;
  }

  .profile-avatar {
    width: 84px;
    height: 84px;
    margin-bottom: 7px;
  }

  .profile-avatar img {
    width: 102px;
    height: 137px;
  }

  .profile-name {
    font-size: clamp(25px, 8vw, 31px);
  }

  .profile-role {
    margin-top: 7px;
  }

  .profile-body {
    padding: 7px 10px 12px;
  }

  .profile-tiers {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
  }

  .profile-tier {
    min-height: 66px;
    padding: 7px 1px 5px;
    grid-template-rows: 25px 12px 17px;
  }

  .profile-tier-icon {
    width: 25px;
    height: 25px;
  }

  .profile-tier-icon svg {
    width: 15px;
    height: 15px;
  }

  .profile-tier-mode {
    font-size: 7px;
    letter-spacing: 0;
  }

  .profile-tier-code {
    min-width: 0;
    padding: 3px 2px;
    font-size: 8px;
  }

  .toast {
    width: min(calc(100% - 24px), 330px);
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* Ranking information popover. */
.info-button {
  border-color: #303d50;
  background: #172237;
}

.info-button svg {
  width: 17px;
  height: 17px;
}

.information-panel {
  position: fixed;
  top: 84px;
  right: max(22px, calc((100vw - 1440px) / 2));
  z-index: 90;
  width: min(388px, calc(100vw - 32px));
  max-height: min(610px, calc(100dvh - 104px));
  overflow-y: auto;
  border: 1px solid #344256;
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(81, 119, 181, .13), transparent 34%),
    #111923;
  box-shadow: 0 24px 75px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.018) inset;
  scrollbar-width: thin;
  scrollbar-color: #43536a #111923;
}

.information-panel-head {
  min-height: 62px;
  padding: 13px 14px 11px 17px;
  border-bottom: 1px solid #283546;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.information-kicker {
  color: #718198;
  display: block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.1px;
}

.information-panel h2 {
  margin: 2px 0 0;
  color: #f4f7fc;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 21px;
  line-height: 1;
}

.information-close {
  width: 32px;
  height: 32px;
  border: 1px solid #38485e;
  border-radius: 8px;
  color: #afbdce;
  background: #19263a;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.information-close svg {
  width: 17px;
  height: 17px;
}

.information-close:hover {
  border-color: #6b7d97;
  color: #ffffff;
  background: #24334a;
}

.information-tabs {
  margin: 12px 14px 0;
  padding: 3px;
  border: 1px solid #344155;
  border-radius: 9px;
  background: #172235;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.information-tab {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: #8593a5;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.information-tab.active {
  color: #f3f6fb;
  background: #2a374d;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

.information-content {
  padding: 13px 14px 15px;
}

.information-tier-row {
  --tier-info: #9eabba;
  padding: 9px 0;
  border-top: 1px solid #243142;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.information-tier-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.information-tier-1 { --tier-info: #f0b857; }
.information-tier-2 { --tier-info: #a9b1b9; }
.information-tier-3 { --tier-info: #d59161; }
.information-tier-4 { --tier-info: #b1c0cc; }
.information-tier-5 { --tier-info: #b1c0cc; }

.information-tier-name {
  min-width: 72px;
  color: var(--tier-info);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.information-tier-name svg {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.25));
}

.information-tier-values {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.information-tier-values span {
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--tier-info) 20%, #354153);
  border-radius: 999px;
  color: #b9c4d1;
  background: color-mix(in srgb, var(--tier-info) 10%, #192331);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.information-tier-values b {
  color: var(--tier-info);
  font-weight: 900;
}

.information-title-row {
  --title-color: #9aa6b5;
  min-height: 42px;
  padding: 8px 10px;
  border-top: 1px solid #263243;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.information-title-row:first-child {
  border-top: 0;
}

.information-title-row span {
  color: var(--title-color);
  font-size: 12px;
  font-weight: 850;
}

.information-title-row strong {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--title-color) 30%, #354153);
  border-radius: 999px;
  color: #dce4ed;
  background: color-mix(in srgb, var(--title-color) 12%, #172230);
  font-size: 10px;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .information-panel:not([hidden]) {
    animation: information-pop-in .2s cubic-bezier(.22,.8,.24,1) both;
  }

  @keyframes information-pop-in {
    from { opacity: 0; transform: translateY(-7px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (max-width: 1080px) {
  .information-panel {
    top: calc(64px + env(safe-area-inset-top) + 10px);
    right: 10px;
  }
}

@media (max-width: 560px) {
  .information-panel {
    top: calc(64px + env(safe-area-inset-top) + 7px);
    right: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 84px - env(safe-area-inset-top));
    border-radius: 12px;
  }

  .information-panel-head {
    min-height: 56px;
    padding: 10px 11px 9px 14px;
  }

  .information-content {
    padding: 11px 12px 13px;
  }

  .information-tabs {
    margin: 10px 12px 0;
  }
}

/* Desktop layout inspired by compact competitive tierlists, using LockedPvP's own palette. */
.player-identity { display: block; }
.player-name-line { min-width: 0; display: flex; align-items: center; gap: 8px; }

.player-ranking-title {
  --title-color: #9aa6b5;
  min-width: 0;
  margin-top: 4px;
  color: var(--title-color);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.player-ranking-title > span { color: color-mix(in srgb, var(--title-color) 82%, #ffffff); font-size: 15px; line-height: 1; }
@media (max-width: 760px) {
  .player-ranking-title { font-size: 10px; }
}

@media (min-width: 1081px) {
  .topbar { top: 4px; width: min(1450px, calc(100% - 8px)); margin: 0 auto; border: 1px solid #202d3d; border-radius: 13px; }
  .topbar-inner { width: calc(100% - 34px); }
  main { width: min(1350px, calc(100% - 34px)); padding-top: 28px; }

  .mode-shell { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .mode-grid { gap: 4px; }
  .mode-button { min-height: 72px; border-color: #1f2b3a; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, rgba(28,39,54,.78), #101720 82%); box-shadow: inset 0 -1px 0 rgba(255,255,255,.02); }
  .mode-button.active { border-color: #314158; color: #ffffff; background: linear-gradient(180deg, rgba(42,55,76,.92), #151f2d 84%); box-shadow: inset 0 -2px 0 #f1f4f8, 0 10px 24px rgba(0,0,0,.16); }
  .mode-button.active::after { display: none; }
  .mode-button.active .mode-icon { color: #f4c94f; }

  .top-actions { margin-right: 286px; }
  .search-bar { position: fixed; top: 14px; right: max(22px, calc((100vw - 1440px) / 2 + 8px)); z-index: 58; width: min(270px, 20vw); margin: 0; }
  #search { height: 46px; padding: 0 16px 0 43px; border-color: #263448; border-radius: 12px; background: #172235; }
  .search-icon { left: 14px; width: 18px; height: 18px; }
  .search-icon svg { width: 18px; height: 18px; }
  .search-bar kbd { display: none; }

  .ranking-card { padding: 0 10px 10px; border-color: #202d3d; border-radius: 15px; background: linear-gradient(180deg, #101720, #0e151e); }
  .ranking-card .table-scroll { overflow: visible; }
  .ranking-card table { border-collapse: separate; border-spacing: 0 8px; }
  .ranking-card thead th { height: 47px; border-bottom: 0; background: transparent; color: #526176; }
  .ranking-card tbody tr { border-top: 0; background: #141d29; }
  .ranking-card tbody tr:hover { transform: translateY(-1px); background: #182332; }
  .ranking-card tbody td { height: 72px; padding-inline: 13px; border-top: 1px solid #202d3d; border-bottom: 1px solid #202d3d; background: linear-gradient(90deg, rgba(255,255,255,.012), transparent 58%), #141d29; }
  .ranking-card tbody td:first-child { width: 112px; border-left: 1px solid #202d3d; border-radius: 12px 0 0 12px; }
  .ranking-card tbody td:last-child { width: 104px; border-right: 1px solid #202d3d; border-radius: 0 12px 12px 0; }
  .ranking-card tbody tr.top td { background: linear-gradient(90deg, color-mix(in srgb, var(--top-color) 7%, #141d29), #141d29 45%); }
  .ranking-card tbody tr.top td::before { top: 0; }

  .rank-number.top { width: 68px; height: 48px; min-width: 68px; border-radius: 8px; font-size: 29px; }
  .rank-number:not(.top) { min-width: 58px; color: #d5dce5; font-family: Rajdhani, Inter, sans-serif; font-size: 28px; font-style: italic; }
  .player-cell { grid-template-columns: minmax(230px, 330px) minmax(0, 1fr); gap: 18px; }
  .player-main { gap: 12px; }
  .avatar { width: 54px; height: 54px; flex-basis: 54px; border-radius: 8px; }
  .player-identity { display: block; }
  .player-name { max-width: 215px; font-size: 24px; }
  .player-name.name-lg { font-size: 20px; }
  .player-name.name-xl { font-size: 17px; }
  .country-badge { height: 25px; }
  .player-tier-list { gap: 6px; }
  .tier-item { min-height: 39px; padding-inline: 4px; }
}

@media (min-width: 1081px) and (max-width: 1180px) {
  .top-actions { margin-right: 0; }
  .search-bar { position: relative; top: auto; right: auto; z-index: auto; width: auto; margin: 15px 0 13px; }
  #search { height: 58px; padding: 0 76px 0 55px; }
  .search-icon { left: 20px; width: 21px; height: 21px; }
  .search-icon svg { width: 21px; height: 21px; }
  .search-bar kbd { display: block; }
}

/* Ranking utilities and progression styling. */
.profile-position {
  background: linear-gradient(100deg, rgba(92,119,157,.09), transparent 52%), #151e29;
}

.profile-modal {
  --profile-glow: rgba(87,115,154,.10);
}

.profile-rank {
  background: linear-gradient(145deg, #26384f, #3b5472 58%, #202e41);
  box-shadow: 0 6px 18px rgba(18,31,48,.31);
}

.information-points-heading {
  margin: 0 0 9px;
  color: #edf2f8;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.15px;
}

.information-tier-legend {
  margin: -2px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #94a2b4;
  font-size: 10px;
  font-weight: 750;
}

.information-tier-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.information-tier-legend img,
.information-division-icon {
  width: 15px;
  height: 15px;
  display: block;
}

.information-tier-legend span:first-child img,
.information-tier-values span:first-child .information-division-icon {
  color: #f4c94f;
}

.information-tier-legend span:last-child img,
.information-tier-values span:last-child .information-division-icon {
  color: #8fa8c9;
}

.information-tier-values span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ranking-card thead th:nth-child(2) {
  position: relative;
  padding-right: 132px;
}

.ranking-player-heading {
  display: inline-block;
}

.ranking-info-button {
  position: absolute;
  top: 6px;
  right: 10px;
  height: 34px;
  padding-inline: 10px;
  border-radius: 8px;
  font-size: 10px;
}

.ranking-info-button svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 760px) {
  .ranking-card thead th:nth-child(2) {
    padding-right: 45px;
  }

  .ranking-info-button {
    top: 5px;
    right: 5px;
    width: 34px;
    padding: 0;
    font-size: 0;
  }
}

.information-tier-row {
  padding: 7px 0;
  border-top: 0;
  display: block;
}

.information-tier-row:first-child {
  padding-top: 2px;
}

.information-tier-name {
  min-width: 0;
  font-size: 13px;
}

.information-tier-values {
  margin: 4px 0 0 2px;
  padding-left: 8px;
  border-left: 2px solid var(--tier-info);
  justify-content: flex-start;
  gap: 5px;
}

.information-tier-values span {
  padding: 5px 8px;
  border: 0;
  color: color-mix(in srgb, var(--tier-info) 82%, #ffffff);
  background: color-mix(in srgb, var(--tier-info) 16%, #1e2938);
  font-size: 10px;
  font-weight: 800;
}

.information-tier-values i {
  margin-right: 3px;
  color: var(--tier-info);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 0;
}

@media (min-width: 1181px) {
  .top-actions { margin-right: 306px; }

  .top-actions,
  .search-bar {
    flex-shrink: 0;
  }

  .search-bar {
    width: 258px;
    top: 20px;
  }

  #search {
    height: 42px;
    border-radius: 9px;
  }

  .ranking-card tbody td {
    height: 78px;
  }

  .player-ranking-title {
    display: flex;
  }
}

@media (max-width: 760px) {
  .profile-name-country {
    width: 36px;
    height: 29px;
    padding: 0 1px;
  }

  .information-points-heading {
    font-size: 12px;
  }

  .profile-overall {
    padding-inline: 9px;
    gap: 7px;
  }

  .profile-overall-title {
    gap: 6px;
    font-size: 14px;
  }

  .profile-overall-title svg {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  .profile-points {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* Main ranking columns: player, points, region and compact tier rail. */
@media (min-width: 761px) {
  .ranking-card thead th:nth-child(2) {
    position: static;
    padding-right: 13px;
  }

  .ranking-card thead th:nth-child(5) {
    position: relative;
    padding-right: 132px;
    text-align: left;
  }

  .ranking-card tbody td:nth-child(1),
  .ranking-card thead th:nth-child(1) { width: 104px; }

  .ranking-card tbody td:nth-child(2),
  .ranking-card thead th:nth-child(2) { width: 300px; }

  .ranking-card tbody td:nth-child(3),
  .ranking-card thead th:nth-child(3) { width: 100px; }

  .ranking-card tbody td:nth-child(4),
  .ranking-card thead th:nth-child(4) { width: 82px; text-align: center; }

  .ranking-card tbody td:nth-child(5),
  .ranking-card thead th:nth-child(5) { width: auto; }

  .ranking-card .player-cell {
    width: 100%;
    min-width: 0;
    display: block;
  }

  .ranking-card .player-main {
    width: 100%;
    min-width: 0;
  }

  .ranking-card .player-name-line {
    min-width: 0;
  }

  .ranking-card .player-ranking-title {
    max-width: 100%;
  }

  .ranking-card .region-column {
    text-align: center;
  }

  .ranking-card .region-column .country-badge {
    width: 36px;
    height: 27px;
    margin: 0 auto;
  }

  .ranking-card .player-tier-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(31px, 1fr));
    align-items: center;
    gap: 6px;
    white-space: normal;
  }

  .ranking-card .tiers-column-cell {
    padding-inline: 10px;
  }

  .ranking-card .tier-item {
    min-width: 0;
    height: 51px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    overflow: visible;
  }

  .ranking-card .tier-item::after {
    display: none;
  }

  .ranking-card .tier-item.selected {
    transform: translateY(-1px);
    border: 0;
    box-shadow: none;
  }

  .ranking-card .tier-symbol {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    border-radius: 50%;
    border-color: color-mix(in srgb, var(--division) 56%, #344052);
    background: color-mix(in srgb, var(--division) 22%, #111923);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--division) 16%, transparent);
  }

  .ranking-card .tier-symbol svg {
    width: 17px;
    height: 17px;
  }

  .ranking-card .tier-code {
    color: var(--division-text);
    font-size: 9px;
    line-height: 1;
  }

  .ranking-card .tier-item-unrated {
    filter: none;
    color: #8994a0;
  }

  .ranking-card .tier-item-unrated::before {
    display: none;
  }

  .ranking-card .tier-item-unrated .tier-symbol {
    opacity: .55;
    border-color: #48515b;
    background: #262d35;
  }
}

@media (max-width: 760px) {
  .ranking-card thead th:nth-child(2) {
    position: static;
    padding-right: 7px;
  }

  .ranking-card thead th:nth-child(5) {
    position: relative;
    padding-right: 40px;
    text-align: left;
  }

  .ranking-card tbody td:nth-child(1),
  .ranking-card thead th:nth-child(1) { width: 48px; }

  .ranking-card tbody td:nth-child(2),
  .ranking-card thead th:nth-child(2) { width: 29%; }

  .ranking-card tbody td:nth-child(3),
  .ranking-card thead th:nth-child(3) { width: 56px; }

  .ranking-card tbody td:nth-child(4),
  .ranking-card thead th:nth-child(4) { width: 42px; text-align: center; }

  .ranking-card tbody td:nth-child(5),
  .ranking-card thead th:nth-child(5) { width: auto; }

  .ranking-card tbody td {
    padding-inline: 5px;
  }

  .ranking-card .points {
    min-width: 0;
    font-size: 12px;
  }

  .ranking-card .player-cell,
  .ranking-card .player-main {
    width: 100%;
    min-width: 0;
  }

  .ranking-card .player-main {
    gap: 6px;
  }

  .ranking-card .avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .ranking-card .player-name {
    max-width: 100%;
    font-size: 14px;
  }

  .ranking-card .player-name.name-lg { font-size: 12px; }
  .ranking-card .player-name.name-xl { font-size: 10px; }

  .ranking-card .player-ranking-title {
    max-width: 100%;
    padding: 2px 4px;
    font-size: 7px;
    gap: 2px;
  }

  .ranking-card .player-ranking-title > span {
    font-size: 9px;
  }

  .ranking-card .region-column .country-badge {
    width: 27px;
    height: 22px;
    margin: 0 auto;
  }

  .ranking-card .region-column .country-flag-image {
    width: 23px;
    height: 16px;
  }

  .ranking-card .player-tier-list {
    grid-template-columns: repeat(7, minmax(16px, 1fr));
    gap: 1px;
  }

  .ranking-card .tier-item {
    height: 42px;
    gap: 2px;
  }

  .ranking-card .tier-symbol {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    border-radius: 50%;
  }

  .ranking-card .tier-symbol svg {
    width: 12px;
    height: 12px;
  }

  .ranking-card .tier-code {
    font-size: 7px;
  }
}

/* Compact tier rail and calmer motion for the main ranking. */
@media (min-width: 761px) {
  .ranking-card .player-tier-list {
    grid-template-columns: repeat(7, 48px);
    justify-content: center;
    gap: 5px;
  }

  .ranking-card tbody tr {
    transition: transform .22s var(--ease), background-color .22s ease, box-shadow .22s ease;
  }

  .ranking-card .tier-item {
    transition: transform .2s var(--ease), opacity .2s ease;
  }

  .ranking-card .tier-symbol {
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
    box-shadow: 0 2px 7px color-mix(in srgb, var(--division) 10%, transparent);
  }

  .ranking-card tbody tr:hover .tier-symbol {
    transform: translateY(-1px);
    box-shadow: 0 4px 9px color-mix(in srgb, var(--division) 17%, transparent);
  }
}

/* Final motion pass: keep interaction feedback consistent and avoid layout jumps. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mode-button,
  .action-button,
  .mobile-menu,
  .search-suggestion,
  .tier-player-row,
  .ranking-card tbody tr,
  .profile-position,
  .profile-tier,
  .profile-tier-icon,
  .information-close,
  .information-tab,
  .profile-section-chevron {
    transition-timing-function: var(--ease);
  }

  .mode-icon {
    transition: transform .24s var(--ease), border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
  }

  .mode-button:hover .mode-icon {
    transform: translateY(-2px) scale(1.035);
    box-shadow: 0 8px 18px rgba(0,0,0,.24);
  }

  .search-suggestion {
    transition: transform .2s var(--ease), background-color .2s ease, color .2s ease;
  }

  .ranking-card tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--top-color, #52657c) 48%, transparent);
  }

  .profile-position {
    transition: transform .24s var(--ease), border-color .24s ease, box-shadow .24s ease, background .24s ease;
  }

  .profile-position:hover {
    transform: translateY(-1px);
    border-color: #40516a;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
  }

  .profile-tier-icon {
    transition: transform .22s var(--ease), border-color .22s ease, box-shadow .22s ease;
  }

  .profile-tier:hover .profile-tier-icon,
  .profile-tier:focus-visible .profile-tier-icon {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--division) 22%, transparent);
  }

  .information-tab,
  .information-close,
  .profile-section-chevron {
    transition: transform .2s var(--ease), color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
  }

  .information-tab:hover:not(.active) {
    color: #e1e8f0;
    background: rgba(255,255,255,.035);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes profile-block-in {
    from {
      opacity: 0;
      transform: translateY(7px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes profile-tier-in {
    from {
      opacity: 0;
      transform: translateY(6px) scale(.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .profile-overlay.open .profile-position {
    animation: profile-block-in .32s .08s var(--ease) both;
  }

  .profile-overlay.open .profile-tiers {
    animation: profile-block-in .34s .12s var(--ease) both;
  }

  .profile-overlay.open .profile-tier {
    animation: profile-tier-in .3s calc(.16s + var(--tier-index, 0) * 28ms) var(--ease) both;
  }

  .profile-overlay.open .profile-tier:nth-child(1) { --tier-index: 0; }
  .profile-overlay.open .profile-tier:nth-child(2) { --tier-index: 1; }
  .profile-overlay.open .profile-tier:nth-child(3) { --tier-index: 2; }
  .profile-overlay.open .profile-tier:nth-child(4) { --tier-index: 3; }
  .profile-overlay.open .profile-tier:nth-child(5) { --tier-index: 4; }
  .profile-overlay.open .profile-tier:nth-child(6) { --tier-index: 5; }
  .profile-overlay.open .profile-tier:nth-child(7) { --tier-index: 6; }
}

/* Keep Top 3 glow away from the numeric and country cells. */
@media (min-width: 761px) {
  .ranking-card tbody tr.top td:nth-child(3)::before,
  .ranking-card tbody tr.top td:nth-child(4)::before {
    display: none;
  }
}

.ranking-card tbody tr.top td::before {
  opacity: .62;
  box-shadow: 0 0 8px var(--top-glow);
}

.ranking-card tbody tr.top .avatar {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--top-color) 22%, transparent),
    0 0 10px color-mix(in srgb, var(--top-color) 42%, transparent);
}

.ranking-card .player-ranking-title {
  box-shadow: 0 0 8px color-mix(in srgb, var(--title-color) 9%, transparent);
}

@media (min-width: 761px) {
  .profile-overall {
    min-width: 0;
    padding-inline: 13px;
    gap: 10px;
  }

  .profile-overall-title {
    min-width: 0;
    gap: 9px;
    font-size: 17px;
    white-space: nowrap;
  }

  .profile-overall-title svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  .profile-points {
    flex: 0 0 auto;
    padding: 7px 11px;
    font-size: 13px;
  }
}

/* Ranking titles inherit the exact title palette used by the profile badge. */
.player-ranking-title {
  color: var(--title-color);
  font-weight: 900;
  text-shadow: 0 0 10px color-mix(in srgb, var(--title-color) 22%, transparent);
}

.player-ranking-title > span {
  color: var(--title-color);
  text-shadow: 0 0 8px color-mix(in srgb, var(--title-color) 35%, transparent);
}

.player-ranking-title {
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--title-color) 48%, #303b49);
  border-radius: 999px;
  background: color-mix(in srgb, var(--title-color) 14%, #111923);
  box-shadow: 0 0 14px color-mix(in srgb, var(--title-color) 13%, transparent);
}

.player-ranking-title.profile-title-none { --title-color: #9aa6b5; }
.player-ranking-title.profile-title-cadete { --title-color: #72a9ff; }
.player-ranking-title.profile-title-aprendiz { --title-color: #62d994; }
.player-ranking-title.profile-title-especialista { --title-color: #be8cff; }
.player-ranking-title.profile-title-profissional { --title-color: #ff9c5b; }
.player-ranking-title.profile-title-mestre-do-combate { --title-color: #ffd34f; }

.player-ranking-title.profile-title-mestre-do-combate {
  text-shadow: 0 0 12px rgba(255,211,79,.36);
}

.profile-title-iniciante {
  --title-color: #8fa8c9;
}

.player-ranking-title.profile-title-iniciante {
  --title-color: #8fa8c9;
}

/* Title cards in the information panel use the same glow language as profiles. */
.information-title-row {
  margin-bottom: 6px;
  border: 1px solid color-mix(in srgb, var(--title-color) 35%, #263243);
  border-top-color: color-mix(in srgb, var(--title-color) 35%, #263243);
  border-radius: 9px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--title-color) 12%, #111923), #111923 74%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--title-color) 10%, transparent);
}

.information-title-row span {
  text-shadow: 0 0 10px color-mix(in srgb, var(--title-color) 28%, transparent);
}

.information-title-row strong {
  box-shadow: 0 0 10px color-mix(in srgb, var(--title-color) 15%, transparent);
}

/* Larger tier-divider cards for desktop readability and sharper player assets. */
@media (min-width: 761px) {
  .tier-columns {
    gap: 11px;
    padding: 13px;
  }

  .tier-column {
    min-width: 0;
    border-radius: 13px;
  }

  .tier-column-title {
    height: 64px;
    padding-inline: 14px;
    gap: 10px;
    font-size: 22px;
  }

  .tier-column-trophy,
  .tier-column-trophy svg {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .tier-player-row {
    position: relative;
    min-height: 54px;
    padding: 7px 12px;
    gap: 10px;
  }

  .tier-player-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #8fa8c9;
    opacity: .9;
    pointer-events: none;
  }

  .tier-player-row.high::before { background: #f4c94f; }
  .tier-player-row.low::before { background: #8fa8c9; }

  .tier-mini-avatar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .tier-mini-name {
    font-size: 16px;
    letter-spacing: -.1px;
  }

  .tier-mini-division {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .tier-mini-division img {
    width: 21px;
    height: 21px;
  }
}

/* Keep the tiers heading and each tier's label on the same visual axis. */
.ranking-card .tiers-column-cell,
.ranking-card .player-tier-list,
.ranking-card .tier-item {
  text-align: center;
}

.ranking-card .player-tier-list {
  justify-content: center;
}

.ranking-card .tier-code {
  display: block;
  width: 100%;
  line-height: 1;
  text-align: center;
}

/* Let the browser skip paint/layout work for rows outside the viewport. */
.ranking-card tbody tr {
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
}

@media (min-width: 761px) {
  .ranking-card thead th:nth-child(5) {
    text-align: center;
  }
}

/* Slightly larger desktop ranking rail and profile, keeping the layout compact. */
@media (min-width: 761px) {
  .profile-position {
    min-height: 68px;
    padding: 8px 11px;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
  }

  .profile-rank {
    font-size: 32px;
  }

  .profile-overall {
    padding-inline: 15px;
    gap: 11px;
  }

  .profile-overall-title {
    gap: 10px;
    font-size: 19px;
  }

  .profile-overall-title svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .profile-points {
    padding: 8px 13px;
    font-size: 14px;
  }

  .profile-tiers {
    padding: 12px;
    gap: 7px;
  }

  .profile-tier {
    min-height: 98px;
    padding: 11px 4px 9px;
    grid-template-rows: 38px 16px 22px;
  }

  .profile-tier-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .profile-tier-icon svg {
    width: 22px;
    height: 22px;
  }

  .profile-tier-mode {
    font-size: 9px;
  }

  .profile-tier-code {
    min-width: 33px;
    padding: 3px 5px;
    font-size: 10px;
  }
}

@media (min-width: 761px) {
  .ranking-card .player-tier-list {
    grid-template-columns: repeat(7, 58px);
    gap: 4px;
  }

  .ranking-card .tier-item {
    height: 64px;
    gap: 5px;
  }

  .ranking-card .tier-symbol {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .ranking-card .tier-symbol svg {
    width: 21px;
    height: 21px;
  }

  .ranking-card .tier-code {
    font-size: 11.5px;
  }

  .profile-modal {
    width: min(640px, calc(100vw - 40px));
  }

  .profile-head {
    padding: 38px 50px 25px;
  }

  .profile-avatar {
    width: 152px;
    height: 152px;
  }

  .profile-avatar img {
    width: 178px;
    height: 236px;
  }

  .profile-name {
    font-size: clamp(30px, 6.5vw, 40px);
  }

  .profile-body {
    padding: 21px 50px 34px;
  }

  .profile-tiers {
    padding: 10px;
    gap: 6px;
  }

  .profile-tier {
    min-height: 88px;
    padding: 10px 4px 8px;
    grid-template-rows: 34px 15px 21px;
  }

  .profile-tier-icon {
    width: 34px;
    height: 34px;
  }

  .profile-tier-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Visible polish pass: stronger feedback without shifting the layout. */
.profile-overlay {
  background:
    radial-gradient(circle at 50% 32%, rgba(86, 119, 163, .13), transparent 38%),
    rgba(0, 0, 0, .78);
}

.profile-modal {
  box-shadow:
    0 34px 110px rgba(0, 0, 0, .64),
    0 0 0 1px rgba(255, 255, 255, .025) inset;
  transform: translateY(24px) scale(.965);
}

.profile-overlay.open .profile-modal {
  transform: translateY(0) scale(1);
}

.profile-position {
  position: relative;
  overflow: hidden;
}

.profile-position::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, rgba(255,255,255,.07), transparent 30% 72%, rgba(255,255,255,.025));
  content: "";
  opacity: .35;
  pointer-events: none;
}

.profile-position > * {
  position: relative;
  z-index: 1;
}

.profile-tier {
  box-shadow: 0 4px 13px rgba(0, 0, 0, .16);
}

.profile-tier:hover,
.profile-tier:focus-visible {
  transform: translateY(-5px) scale(1.012);
  box-shadow:
    0 15px 29px rgba(0, 0, 0, .35),
    0 0 0 1px color-mix(in srgb, var(--division) 26%, transparent) inset,
    0 0 18px color-mix(in srgb, var(--division) 18%, transparent);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .profile-overlay.open .profile-modal {
    transition-duration: .38s;
  }

  .mode-button:hover {
    transform: translateY(-4px);
    border-color: #536b88;
    box-shadow: 0 16px 31px rgba(0,0,0,.26), 0 0 0 1px rgba(145, 172, 207, .08) inset;
  }

  .action-button:hover,
  .mobile-menu:hover {
    transform: translateY(-3px) scale(1.015);
  }

  .ranking-card tbody tr:hover .avatar {
    transform: translateY(-2px) scale(1.045);
  }

  .ranking-card tbody tr:hover .player-ranking-title {
    transform: translateX(2px);
  }

  .ranking-card .avatar,
  .ranking-card .player-ranking-title {
    transition: transform .24s var(--ease), box-shadow .24s ease, border-color .24s ease;
  }

  .ranking-card tbody tr:hover .tier-item:not(.tier-item-unrated) {
    transform: translateY(-2px);
  }

  .ranking-card .tier-item {
    transition: transform .24s var(--ease), opacity .24s ease, box-shadow .24s ease;
  }

  .tier-player-row:hover {
    transform: translateX(4px);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--division, #8fa8c9) 72%, transparent);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes profile-modal-in {
    from { opacity: .72; transform: translateY(24px) scale(.965); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .profile-overlay.open .profile-modal {
    animation: profile-modal-in .4s var(--ease) both;
  }
}

/* Contain rank highlights: no pseudo-line or glow may cross the row background. */
.ranking-card tbody tr.top td::before {
  display: none !important;
  box-shadow: none !important;
}

.ranking-card tbody tr.top td {
  box-shadow: none;
  border-top-color: color-mix(in srgb, var(--top-color) 28%, #202d3d);
}

/* Profile tiers use a viewport tooltip layer, so their decorative glow can be clipped safely. */
#profileTiers .profile-tier {
  overflow: hidden;
}

/* Keep the profile rank glow close to its subject instead of washing the modal. */
.profile-modal.profile-first .profile-avatar {
  box-shadow:
    0 0 0 2px rgba(244, 201, 79, .18),
    0 0 18px rgba(244, 201, 79, .27),
    0 18px 36px rgba(0, 0, 0, .32);
}

/* Global ranking: hide the standalone country column and keep its flag by the nick. */
.ranking-card thead th:nth-child(4),
.ranking-card tbody td:nth-child(4) {
  display: none !important;
}

.ranking-card .player-name-line {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  gap: 7px;
}

.ranking-card .player-mobile-country {
  width: 36px;
  height: 27px;
  padding: 2px;
  border: 1px solid #3a4a5f;
  border-radius: 8px;
  background: #172235;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: border-color .22s ease, background-color .22s ease, box-shadow .22s ease, transform .22s var(--ease);
}

.ranking-card .player-mobile-country .country-flag-image {
  width: 29px;
  height: 19px;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .ranking-card .player-mobile-country {
    width: 30px;
    height: 21px;
    padding: 2px;
    border-radius: 6px;
  }

  .ranking-card .player-mobile-country .country-flag-image {
    width: 25px;
    height: 16px;
    border-radius: 3px;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ranking-card tbody tr:hover .player-mobile-country {
    border-color: #6682a5;
    background: #1d2d44;
    box-shadow: 0 4px 12px rgba(39, 66, 101, .3);
    transform: translateY(-1px);
  }

  .ranking-card tbody tr:hover .player-name {
    color: #ffffff;
  }
}

.profile-modal.profile-second .profile-avatar {
  box-shadow:
    0 0 0 2px rgba(203, 212, 220, .16),
    0 0 18px rgba(203, 212, 220, .22),
    0 18px 36px rgba(0, 0, 0, .32);
}

.profile-modal.profile-third .profile-avatar {
  box-shadow:
    0 0 0 2px rgba(199, 123, 72, .17),
    0 0 18px rgba(199, 123, 72, .24),
    0 18px 36px rgba(0, 0, 0, .32);
}

/* Restore the original Top 3 rail, but keep it clipped to the row cells. */
.ranking-card tbody tr.top td {
  position: relative;
  overflow: hidden;
}

.ranking-card tbody tr.top td::before {
  display: block !important;
  z-index: 2;
  top: 0;
  height: 2px;
  box-shadow: 0 0 12px var(--top-glow);
  opacity: .82;
}

/* The row itself remains the only moving surface on hover. */
@media (hover: hover) {
  .ranking-card tbody tr:hover {
    box-shadow: none !important;
  }

  .ranking-card tbody tr:hover .avatar,
  .ranking-card tbody tr:hover .player-ranking-title,
  .ranking-card tbody tr:hover .tier-item:not(.selected) {
    transform: none !important;
  }
}

/* Row hover: one connected lift, with a calm surface response. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ranking-card tbody tr {
    transition: transform .26s var(--ease), background-color .26s ease;
  }

  .ranking-card tbody tr td {
    transition: background .26s ease, border-color .26s ease;
  }

  .ranking-card tbody tr:hover {
    transform: translateY(-2px);
  }

  .ranking-card tbody tr:not(.top):hover td {
    border-top-color: #3b4b61;
    border-bottom-color: #3b4b61;
    background: linear-gradient(100deg, rgba(255,255,255,.045), transparent 68%), #182332;
  }

  .ranking-card tbody tr.top:hover td {
    border-top-color: color-mix(in srgb, var(--top-color) 52%, #3b4b61);
    border-bottom-color: color-mix(in srgb, var(--top-color) 34%, #3b4b61);
    background: linear-gradient(100deg, color-mix(in srgb, var(--top-color) 11%, #182332), #182332 68%);
  }

  .ranking-card tbody tr:hover td:first-child {
    border-left-color: #465a73;
  }

  .ranking-card tbody tr:hover td:last-child {
    border-right-color: #465a73;
  }
}

/* Profile tiers now use the same compact visual language as the main ranking. */
.profile-tiers {
  padding: 14px;
  gap: 8px;
  background: linear-gradient(180deg, #141f2b, #101821);
}

.profile-tier {
  min-height: 104px;
  padding: 11px 5px 9px;
  grid-template-rows: 42px 16px 23px;
  gap: 4px;
  border-radius: 11px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--division) 15%, transparent), transparent 72%),
    var(--division-bg, #101821);
}

.profile-tier-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 3px 9px color-mix(in srgb, var(--division) 14%, transparent);
}

.profile-tier-icon svg {
  width: 23px;
  height: 23px;
}

.profile-tier-mode {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .55px;
}

.profile-tier-code {
  min-width: 39px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.profile-tier::before {
  height: 3px;
}

@media (max-width: 760px) {
  .profile-tiers {
    padding: 9px;
    gap: 4px;
  }

  .profile-tier {
    min-height: 82px;
    padding: 8px 2px 6px;
    grid-template-rows: 31px 13px 19px;
    gap: 3px;
  }

  .profile-tier-icon {
    width: 31px;
    height: 31px;
  }

  .profile-tier-icon svg {
    width: 17px;
    height: 17px;
  }

  .profile-tier-mode {
    font-size: 7px;
    letter-spacing: .1px;
  }

  .profile-tier-code {
    min-width: 30px;
    padding: 3px 5px;
    font-size: 9px;
  }
}

/* Title identity: one icon and one controlled color per progression level. */
.profile-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--title-color);
  text-shadow: 0 0 10px color-mix(in srgb, var(--title-color) 24%, transparent);
}

.profile-role > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--title-color);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--title-color) 48%, transparent));
}

.player-ranking-title {
  color: var(--title-color);
}

.player-ranking-title .title-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-grid;
  place-items: center;
  color: var(--title-color);
  line-height: 1;
}

.player-ranking-title .title-icon-svg {
  width: 15px;
  height: 15px;
  color: var(--title-color);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--title-color) 50%, transparent));
}

.player-ranking-title .title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-ranking-title.profile-title-mestre-do-combate .title-icon-svg {
  filter: drop-shadow(0 0 6px rgba(255, 211, 79, .82));
}

.player-ranking-title.profile-title-profissional .title-icon-svg {
  filter: drop-shadow(0 0 5px rgba(255, 156, 91, .68));
}

.player-ranking-title.profile-title-especialista .title-icon-svg {
  filter: drop-shadow(0 0 5px rgba(190, 140, 255, .68));
}

.player-ranking-title.profile-title-aprendiz .title-icon-svg {
  filter: drop-shadow(0 0 5px rgba(98, 217, 148, .62));
}

.player-ranking-title.profile-title-cadete .title-icon-svg {
  filter: drop-shadow(0 0 5px rgba(114, 169, 255, .62));
}

/* Points read as a compact metric instead of a pill with the old “pts” suffix. */
.ranking-card .points {
  min-width: 86px;
  padding-block: 7px;
  color: #f4f6f9;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
}

.ranking-card .points strong {
  display: block;
  color: #f4f6f9;
  font-family: Rajdhani, Inter, sans-serif;
  font-size: 23px;
  font-weight: 900;
  line-height: .9;
}

.ranking-card .points small {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  color: #7f91a7;
  background: transparent;
  font-family: Inter, sans-serif;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .9px;
  line-height: 1;
  text-transform: uppercase;
}

/* Title information keeps the label, unlock requirement and effect visibly separate. */
.information-title-row.profile-title-iniciante { --title-color: #8fa8c9; }
.information-title-row.profile-title-cadete { --title-color: #72a9ff; }
.information-title-row.profile-title-aprendiz { --title-color: #62d994; }
.information-title-row.profile-title-especialista { --title-color: #be8cff; }
.information-title-row.profile-title-profissional { --title-color: #ff9c5b; }
.information-title-row.profile-title-mestre-do-combate { --title-color: #ffd34f; }

.information-title-name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--title-color) !important;
  text-shadow: none !important;
}

.information-title-name > span:last-child {
  color: var(--title-color) !important;
  font-size: 12px;
  font-weight: 900;
}

.information-title-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  color: var(--title-color) !important;
}

.information-title-icon svg {
  width: 18px;
  height: 18px;
  color: var(--title-color);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--title-color) 48%, transparent));
}

.information-title-row > strong {
  min-width: 112px;
  display: grid;
  justify-items: end;
  gap: 2px;
  padding: 5px 8px;
  border-color: color-mix(in srgb, var(--title-color) 36%, #354153);
  border-radius: 9px;
  color: var(--title-color);
  background: color-mix(in srgb, var(--title-color) 10%, #172230);
  box-shadow: 0 0 10px color-mix(in srgb, var(--title-color) 12%, transparent);
  font-size: 10px;
  white-space: nowrap;
}

.information-title-threshold {
  color: var(--title-color) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

.information-title-effect {
  color: #9aa8b8 !important;
  font-size: 8px !important;
  font-weight: 800 !important;
  letter-spacing: .55px;
  line-height: 1.1;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .ranking-card .points {
    min-width: 48px;
    padding-block: 5px;
  }

  .ranking-card .points strong {
    font-size: 17px;
  }

  .ranking-card .points small {
    margin-top: 3px;
    font-size: 7px;
    letter-spacing: .45px;
  }

  .information-title-row > strong {
    min-width: 102px;
  }
}

/* Final ranking alignment pass. The table uses one stable column system so headings
   and row content keep the same visual axis at every desktop width. */
@media (min-width: 761px) {
  .ranking-card {
    overflow: hidden;
  }

  .ranking-card .table-scroll {
    overflow: visible;
  }

  .ranking-card table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  .ranking-card thead th {
    height: 42px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #718096;
    vertical-align: middle;
    line-height: 1;
  }

  .ranking-card thead th:nth-child(1),
  .ranking-card tbody td:nth-child(1) {
    width: clamp(68px, 8vw, 104px);
    text-align: center;
  }

  .ranking-card thead th:nth-child(2),
  .ranking-card tbody td:nth-child(2) {
    width: clamp(225px, 26vw, 340px);
    text-align: left;
  }

  .ranking-card thead th:nth-child(3),
  .ranking-card tbody td:nth-child(3) {
    width: clamp(72px, 8vw, 100px);
    text-align: center;
  }

  .ranking-card thead th:nth-child(4),
  .ranking-card tbody td:nth-child(4) {
    display: none !important;
  }

  .ranking-card thead th:nth-child(5) {
    width: auto;
    padding-inline: 0 !important;
    text-align: center !important;
  }

  .ranking-card .ranking-player-heading {
    display: block;
    width: 100%;
    text-align: center;
  }

  .ranking-card tbody td {
    height: 78px;
    padding-inline: 10px;
    vertical-align: middle;
  }

  .ranking-card tbody td:nth-child(2) {
    padding-inline: 12px 10px;
  }

  .ranking-card tbody td:nth-child(5) {
    padding-inline: 6px !important;
    text-align: center;
  }

  .ranking-card .player-cell,
  .ranking-card .player-main {
    width: 100%;
    min-width: 0;
  }

  .ranking-card .player-main {
    flex: 1 1 auto;
    align-items: center;
  }

  .ranking-card .player-identity {
    min-width: 0;
    flex: 1 1 auto;
    align-self: center;
  }

  .ranking-card .player-name-line {
    width: max-content;
    max-width: 100%;
    align-items: center;
  }

  .ranking-card .player-ranking-title {
    width: max-content;
    max-width: 100%;
    margin-inline: 0;
    align-self: flex-start;
  }

  .ranking-card .player-tier-list {
    width: 100%;
    max-width: 430px;
    margin-inline: auto;
    grid-template-columns: repeat(7, minmax(31px, 48px));
    justify-content: center;
    align-items: center;
    gap: 5px;
  }

  .ranking-card .points {
    justify-items: center;
  }

  .ranking-card tbody tr:focus-visible {
    outline: 2px solid #7da7db;
    outline-offset: 3px;
  }
}

/* Mobile rows are intentionally two-level: identity above, tier rail below. */
@media (max-width: 760px) {
  .ranking-card thead tr,
  .ranking-card tbody tr {
    grid-template-columns: 52px minmax(0, 1fr) 72px;
  }

  .ranking-card thead {
    padding-inline: 3px;
  }

  .ranking-card thead th:nth-child(1),
  .ranking-card thead th:nth-child(2),
  .ranking-card thead th:nth-child(3) {
    text-align: left;
  }

  .ranking-card thead th:nth-child(1) {
    text-align: center;
  }

  .ranking-card thead th:nth-child(3) {
    text-align: center;
  }

  .ranking-card thead th:nth-child(5) {
    padding-right: 40px !important;
    text-align: left !important;
  }

  .ranking-card tbody {
    padding-inline: 2px;
  }

  .ranking-card tbody tr {
    gap: 9px 7px;
    padding: 11px 7px 10px;
  }

  .ranking-card tbody td:nth-child(1) {
    text-align: center;
  }

  .ranking-card tbody td:nth-child(3) {
    align-self: center;
    text-align: center;
  }

  .ranking-card tbody td:nth-child(5) {
    padding-top: 10px !important;
    text-align: center;
  }

  .ranking-card .player-main {
    gap: 7px;
  }

  .ranking-card .player-identity {
    align-self: center;
  }

  .ranking-card .player-name-line {
    width: 100%;
    gap: 5px;
  }

  .ranking-card .player-ranking-title {
    width: max-content;
    max-width: 100%;
  }

  .ranking-card .player-tier-list {
    width: 100%;
    grid-template-columns: repeat(7, minmax(24px, 1fr));
    gap: 2px;
  }

  .ranking-card .tier-item {
    min-width: 0;
    width: 100%;
  }

  .ranking-card .tier-code {
    font-size: 8px;
    line-height: 1;
  }

  .ranking-card tbody tr:focus-visible {
    outline: 2px solid #7da7db;
    outline-offset: 2px;
  }
}

/* Keep all ranking labels crisp and avoid inherited glow spilling into columns. */
.ranking-card thead th,
.ranking-card .points,
.ranking-card .tier-code {
  text-shadow: none;
}

.ranking-card .points strong {
  letter-spacing: .15px;
}

.ranking-card .player-name,
.ranking-card .player-ranking-title,
.ranking-card .tier-code {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ranking rows: a taller, calmer surface inspired by the reference layout. */
@media (min-width: 761px) {
  .ranking-card {
    padding-bottom: 12px;
    background: linear-gradient(180deg, #101720 0%, #0e151e 100%);
  }

  .ranking-card table {
    border-spacing: 0 10px;
  }

  .ranking-card thead th {
    height: 48px;
    color: #69788d;
    letter-spacing: 1.2px;
  }

  .ranking-card tbody td {
    height: 92px;
    border-top-color: #263449;
    border-bottom-color: #263449;
    background: #141d29;
  }

  .ranking-card tbody td:first-child {
    border-left-color: #263449;
  }

  .ranking-card tbody td:last-child {
    border-right-color: #263449;
  }

  .ranking-card tbody tr.top td,
  .ranking-card tbody tr.top:hover td {
    border-top-color: #263449;
    border-bottom-color: #263449;
    background: #141d29;
  }

  .ranking-card tbody tr.top td::before {
    display: none !important;
  }

  .ranking-card .avatar,
  .ranking-card tbody tr.top .avatar {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 10px;
  }

  .ranking-card .player-main {
    gap: 14px;
  }

  .ranking-card .player-name {
    max-width: 235px;
    font-size: 25px;
  }

  .ranking-card .player-name.name-lg { font-size: 21px; }
  .ranking-card .player-name.name-xl { font-size: 18px; }

  .ranking-card .player-ranking-title {
    margin-top: 5px;
    padding-block: 4px;
  }

  .ranking-card .points strong {
    font-size: 25px;
  }

  .ranking-card .player-tier-list {
    max-width: 455px;
    grid-template-columns: repeat(7, minmax(36px, 48px));
    gap: 6px;
  }

  .ranking-card .tier-item {
    height: 64px;
  }

  .ranking-card .tier-symbol {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .ranking-card .tier-symbol svg {
    width: 20px;
    height: 20px;
  }

  .ranking-card .tier-code {
    font-size: 10px;
  }

  .ranking-card tbody tr:not(.top):hover td,
  .ranking-card tbody tr.top:hover td {
    border-top-color: #3b4b61;
    border-bottom-color: #3b4b61;
    background: #182332;
  }

  .ranking-card tbody tr:hover td:first-child {
    border-left-color: #3b4b61;
  }

  .ranking-card tbody tr:hover td:last-child {
    border-right-color: #3b4b61;
  }
}

/* Mobile keeps the two-level row, but gives the player rail enough breathing room. */
@media (max-width: 760px) {
  .ranking-card tbody tr {
    padding: 13px 8px 12px;
    gap: 10px 7px;
  }

  .ranking-card tbody tr.top {
    border-top: 1px solid #2c3a4e;
  }

  .ranking-card tbody tr.top td::before {
    display: none !important;
  }

  .ranking-card .avatar,
  .ranking-card tbody tr.top .avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 9px;
  }

  .ranking-card .player-name {
    font-size: 16px;
  }

  .ranking-card .player-ranking-title {
    margin-top: 4px;
    padding-block: 3px;
  }

  .ranking-card tbody td:nth-child(5) {
    padding-top: 12px !important;
  }

  .ranking-card .player-tier-list {
    grid-template-columns: repeat(7, minmax(25px, 1fr));
    gap: 3px;
  }

  .ranking-card .tier-item {
    height: 47px;
  }

  .ranking-card .tier-symbol {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  .ranking-card .tier-symbol svg {
    width: 14px;
    height: 14px;
  }

  .ranking-card tbody tr:hover,
  .ranking-card tbody tr:not(.top):hover td,
  .ranking-card tbody tr.top:hover td {
    background: #182332;
  }
}

/* The row itself owns the hover state; no decorative light is allowed to span it. */
.ranking-card tbody tr.top td::before,
.ranking-card tbody tr.top td::after {
  display: none !important;
  content: none !important;
  box-shadow: none !important;
}

.ranking-card tbody tr.top td {
  box-shadow: none !important;
}

/* Restore the balanced centered tier rail. */
@media (min-width: 761px) {
  .ranking-card .player-tier-list {
    margin-inline: auto;
    justify-content: center;
  }
}

/* Keep the primary navigation visible while the ranking list scrolls. */
.topbar {
  position: relative !important;
  inset: auto;
  width: 100%;
  z-index: 50;
  transform: none;
}

main {
  padding-top: 28px;
}

@media (min-width: 1081px) {
  .topbar {
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(1450px, calc(100% - 8px));
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  main {
    padding-top: 20px;
  }
}

/* Search belongs to the document flow; it must leave the viewport with the page. */
.search-bar {
  position: relative !important;
  inset: auto !important;
  z-index: auto !important;
}

/* Desktop search sits inside the top navigation area but still scrolls with the page. */
@media (min-width: 1181px) {
  .search-bar {
    position: absolute !important;
    top: 16px !important;
    right: max(22px, calc((100vw - 1440px) / 2 + 8px)) !important;
    width: 258px;
    margin: 0;
    z-index: 55 !important;
  }

  .search-bar #search {
    height: 42px;
    border-radius: 9px;
  }
}

/* Information titles follow a compact, readable reference-list layout. */
.information-tabs {
  margin-top: 10px;
  padding: 3px;
  border: 0;
  border-radius: 9px;
  background: #202b3d;
}

.information-tab {
  min-height: 30px;
  border: 1px solid transparent;
  color: #8d99aa;
  font-size: 11px;
  font-weight: 850;
}

.information-tab.active {
  border-color: #53647d;
  color: #f5f7fb;
  background: #303d53;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.information-titles-heading {
  margin: 0 0 10px;
  color: #edf2f8;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
}

.information-title-list {
  display: grid;
  gap: 2px;
}

.information-title-row {
  min-height: 0;
  margin: 0;
  padding: 5px 2px;
  border: 0;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: start;
  justify-content: initial;
  gap: 7px;
  background: transparent;
  box-shadow: none;
}

.information-title-row:first-child {
  padding-top: 1px;
}

.information-title-row:hover {
  background: color-mix(in srgb, var(--title-color) 5%, transparent);
}

.information-title-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  color: var(--title-color) !important;
}

.information-title-icon svg {
  width: 18px;
  height: 18px;
  color: var(--title-color);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--title-color) 46%, transparent));
}

.information-title-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding-top: 1px;
}

.information-title-name {
  display: block;
  min-width: 0;
  padding: 0;
  color: var(--title-color) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.1;
  text-shadow: 0 0 8px color-mix(in srgb, var(--title-color) 22%, transparent) !important;
}

.information-title-requirement {
  display: block;
  color: #9aa7b7 !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  line-height: 1.2;
  white-space: normal;
}

@media (max-width: 560px) {
  .information-titles-heading {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .information-title-row {
    padding-block: 4px;
  }

  .information-title-name {
    font-size: 12px !important;
  }

  .information-title-requirement {
    font-size: 9px !important;
  }
}

/* Give the profile title badge a little more presence without enlarging the modal. */
.profile-role {
  padding: 6px 12px;
  gap: 8px;
  font-size: 12px;
  line-height: 1.15;
}

.profile-role > svg {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

@media (max-width: 760px) {
  .profile-role {
    padding: 5px 10px;
    gap: 6px;
    font-size: 11px;
  }

  .profile-role > svg {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }
}
