.rankings-page {
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding: 36px 0 100px;
}

.rankings-hero {
  position: relative;
  overflow: hidden;
  padding: 36px 32px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 220, 70, 0.35), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(46, 199, 255, 0.28), transparent 24%),
    radial-gradient(circle at 80% 90%, rgba(255, 80, 80, 0.22), transparent 28%),
    linear-gradient(135deg, #2454ff 0%, #14227b 48%, #090d2a 100%);
  border: 3px solid #ffcf33;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34), 0 9px 0 #071126;
}

.rankings-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0 46%,
    rgba(255, 255, 255, 0.07) 46% 49%,
    transparent 49% 100%
  );
  pointer-events: none;
}

.rankings-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffcf33;
  color: #171717;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
  margin-bottom: 16px;
}

.rankings-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.rankings-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 760px;
  font-size: 16px;
  line-height: 1.75;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.88);
}

/* ===== PANEL ===== */

.rankings-panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 207, 51, 0.16), transparent 24%),
    radial-gradient(circle at 90% 10%, rgba(55, 198, 255, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(28, 42, 116, 0.98), rgba(10, 15, 48, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.rankings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(6, 11, 38, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.ranking-tab {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  cursor: pointer;
  background: transparent;
  color: #cbd5ff;
  font-size: 14px;
  font-weight: 900;
  border: 2px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.ranking-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.ranking-tab.active {
  background: linear-gradient(180deg, #ffe45b 0%, #ffb800 100%);
  color: #151515;
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 0 #a16c00, 0 14px 28px rgba(255, 184, 0, 0.22);
}

.ranking-tab:disabled,
.ranking-refresh-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* ===== CONTROLS ===== */

.rankings-controls {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.ranking-select-wrap {
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}

.ranking-select-wrap.active {
  display: flex;
}

.ranking-select-wrap label {
  color: #aebaff;
  font-size: 13px;
  font-weight: 900;
}

.ranking-select-wrap select {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 11, 38, 0.78);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  outline: none;
}

.ranking-select-wrap select option {
  color: #111827;
  background: #ffffff;
}

.ranking-refresh-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe45b 0%, #ffb800 100%);
  color: #151515;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 0 #a16c00, 0 14px 28px rgba(255, 184, 0, 0.22);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.ranking-refresh-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.ranking-refresh-btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #a16c00, 0 10px 22px rgba(255, 184, 0, 0.18);
}

/* ===== STATUS ===== */

.rankings-status {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5ff;
  font-size: 14px;
  font-weight: 800;
}

.rankings-status.success {
  color: #9effaa;
  border-color: rgba(118, 233, 128, 0.2);
  background: rgba(118, 233, 128, 0.08);
}

.rankings-status.error {
  color: #ff9b9b;
  border-color: rgba(255, 107, 107, 0.22);
  background: rgba(255, 107, 107, 0.08);
}

/* ===== QUICK STATS ===== */

.rankings-stats {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.rankings-stats.active {
  display: grid;
}

.stats-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 104px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(7, 13, 48, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: rgba(255, 207, 51, 0.12);
}

.stats-card span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 10px;
  color: #9eabed;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stats-card strong {
  position: relative;
  z-index: 1;
  display: block;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-card.highlight {
  background:
    radial-gradient(circle at top right, rgba(255, 207, 51, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(50, 80, 210, 0.96), rgba(15, 28, 95, 0.96));
  border-color: rgba(255, 207, 51, 0.18);
}

/* ===== LIST ===== */

.rankings-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 80px 58px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(7, 13, 48, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ranking-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 207, 51, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(7, 13, 48, 0.88);
}

.ranking-card.top-highlight {
  border: 2px solid rgba(255, 207, 51, 0.78);
  background:
    radial-gradient(circle at top right, rgba(255, 207, 51, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(7, 13, 48, 0.92);
}

.ranking-card.top-highlight .ranking-info h2 {
  font-size: 22px;
}

.ranking-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5ff;
  font-size: 18px;
  font-weight: 950;
}

.ranking-position.top-rank {
  background: linear-gradient(180deg, #ffe45b 0%, #ffb800 100%);
  color: #151515;
  box-shadow: 0 6px 0 #a16c00;
}

.ranking-avatar {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffdd48, #ff9f1c);
  box-shadow: 0 6px 0 #9c5b00;
  overflow: hidden;
}

.ranking-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.32));
}

.ranking-info {
  min-width: 0;
}

.ranking-info h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.ranking-info p {
  margin: 0;
  color: #aebaff;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 750;
  word-break: break-word;
}

.ranking-trophies {
  text-align: right;
  min-width: 130px;
}

.ranking-trophies span {
  display: block;
  margin-bottom: 6px;
  color: #9eabed;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-trophies strong {
  display: block;
  color: #ffe45b;
  font-size: 23px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.ranking-empty {
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5ff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

/* ===== CUSTOM BRAWLER SELECT ===== */

.custom-brawler-select {
  position: relative;
  width: 100%;
  z-index: 20;
}

.custom-brawler-button {
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 18px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(6, 11, 38, 0.86);
  border: 2px solid rgba(255, 207, 51, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-brawler-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.custom-brawler-left img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.34));
}

.custom-brawler-left strong {
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-brawler-placeholder {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe45b, #ffb800);
  color: #151515;
  font-weight: 900;
}

.custom-brawler-arrow {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #ffcf33;
  transition: transform 0.18s ease;
}

.custom-brawler-arrow svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.custom-brawler-select.open .custom-brawler-arrow {
  transform: rotate(180deg);
}

.custom-brawler-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  max-height: 330px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 207, 51, 0.12), transparent 30%),
    linear-gradient(180deg, #14227b 0%, #090d2a 100%);
  border: 2px solid rgba(255, 207, 51, 0.24);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.38), 0 6px 0 #071126;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.custom-brawler-select.open .custom-brawler-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-brawler-option {
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.custom-brawler-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.custom-brawler-option.active {
  background: linear-gradient(180deg, #ffe45b, #ffb800);
  color: #151515;
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 4px 0 #a16c00;
}

.custom-brawler-option img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.34));
}

.custom-brawler-option span {
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-brawler-menu::-webkit-scrollbar {
  width: 8px;
}

.custom-brawler-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.custom-brawler-menu::-webkit-scrollbar-thumb {
  background: #ffcf33;
  border-radius: 999px;
}

/* ===== INFO CONTENT BLOCKS ===== */

.rankings-info {
  margin-top: 28px;
  padding: 28px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 207, 51, 0.14), transparent 26%),
    radial-gradient(circle at 90% 15%, rgba(46, 199, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(20, 31, 93, 0.98), rgba(8, 12, 42, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.rankings-info-head {
  margin-bottom: 20px;
}

.rankings-info-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffcf33;
  color: #171717;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
}

.rankings-info h2 {
  margin: 18px 0 0;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.rankings-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rankings-info-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(7, 13, 48, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rankings-info-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: rgba(255, 207, 51, 0.1);
}

.rankings-info-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.rankings-info-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #aebaff;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 650;
}

.rankings-tips {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 207, 51, 0.08);
  border: 1px solid rgba(255, 207, 51, 0.18);
}

.rankings-tips h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
}

.rankings-tips p {
  margin: 0;
  color: #cbd5ff;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 650;
}

/* ===== MOBILE ===== */

@media (max-width: 980px) {
  .rankings-stats,
  .rankings-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  } 
}

@media (max-width: 760px) {
  .rankings-page {
    width: min(100% - 24px, 1180px);
    padding: 24px 0 90px;
  }

  .rankings-hero {
    padding: 28px 20px;
    border-radius: 26px;
  }

  .rankings-hero h1 {
    font-size: 38px;
  }

  .rankings-hero p {
    font-size: 14px;
  }

  .rankings-panel,
  .rankings-info {
    padding: 16px;
    border-radius: 26px;
  }

  .ranking-tab {
    width: 100%;
  }

  .rankings-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .ranking-select-wrap {
    min-width: 100%;
  }

  .rankings-stats,
  .rankings-info-grid {
    grid-template-columns: 1fr;
  }

  .stats-card {
    min-height: 92px;
  }

  .ranking-card {
    grid-template-columns: 58px 50px 1fr;
    gap: 12px;
    padding: 15px;
  }

  .ranking-card:hover {
    transform: none;
  }

  .ranking-card.top-highlight .ranking-info h2 {
    font-size: 17px;
  }

  .ranking-position {
    min-height: 40px;
    font-size: 15px;
  }

  .ranking-avatar {
    width: 50px;
    height: 50px;
  }

  .ranking-avatar img {
    width: 42px;
    height: 42px;
  }

  .ranking-info h2 {
    font-size: 16px;
  }

  .ranking-trophies {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ranking-trophies span {
    margin-bottom: 0;
  }

  .custom-brawler-menu {
    max-height: 280px;
  }

  .custom-brawler-button {
    min-height: 54px;
  }

  .rankings-info h2 {
    font-size: 30px;
  }

  .rankings-info-card {
    min-height: auto;
  }
}