.rk-shell {
  --rk-gold: #f1bd4b;
  --rk-gold-soft: rgba(241, 189, 75, 0.18);
  --rk-line: rgba(241, 189, 75, 0.18);
  --rk-card: rgba(9, 15, 22, 0.88);
  --rk-card-2: rgba(12, 18, 27, 0.78);
  --rk-muted: rgba(232, 237, 244, 0.62);
  color: #e8edf4;
  padding: 18px 0 46px;
}

.rk-inner {
  width: min(100% - 48px, 1200px);
  margin: 0 auto;
}

.rk-layout {
  border: 1px solid var(--rk-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 11, 17, 0.92), rgba(7, 11, 17, 0.98)),
    radial-gradient(circle at 70% 0%, rgba(241, 189, 75, 0.08), transparent 44%);
  overflow: hidden;
  position: relative;
}

.rk-layout::before {
  content: "";
  display: block;
  min-height: 230px;
  background:
    linear-gradient(90deg, rgba(6, 11, 17, 0.96) 0%, rgba(6, 11, 17, 0.82) 33%, rgba(6, 11, 17, 0.24) 72%, rgba(6, 11, 17, 0.78) 100%),
    url("../images/pages/rankings/hero.png") center right / cover no-repeat;
  border-bottom: 1px solid rgba(241, 189, 75, 0.12);
}

.rk-shell--clan .rk-layout::before {
  background:
    linear-gradient(90deg, rgba(6, 11, 17, 0.96) 0%, rgba(6, 11, 17, 0.82) 33%, rgba(6, 11, 17, 0.24) 72%, rgba(6, 11, 17, 0.78) 100%),
    url("../images/pages/clan/hero.png") center right / cover no-repeat;
}

.rk-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
}

.rk-layout::before {
  grid-column: 1 / -1;
  grid-row: 1;
}

.rk-hero-copy {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 2;
  width: min(760px, 100%);
  padding: 38px 42px 34px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.rk-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: rgba(232, 237, 244, 0.62);
  font-size: 13px;
  text-transform: uppercase;
}

.rk-breadcrumb i {
  color: var(--rk-gold);
  font-size: 11px;
}

.rk-breadcrumb span:last-child {
  color: rgba(255, 255, 255, 0.9);
}

.rk-hero-copy h1 {
  margin: 0;
  color: var(--rk-gold);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: .035em;
  text-transform: uppercase;
  font-weight: 400;
  text-shadow: none;
}

.rk-hero-copy p {
  max-width: 560px;
  margin: 14px 0 0;
  color: rgba(245, 247, 250, 0.9);
  font-size: 15px;
  line-height: 1.55;
}

.rk-sidebar,
.rk-content {
  grid-row: 2;
}

.rk-sidebar {
  padding: 18px;
  border-right: 1px solid rgba(241, 189, 75, 0.14);
  background: rgba(6, 10, 16, 0.36);
}

.rk-nav {
  display: grid;
  gap: 9px;
}

.rk-nav + .rk-nav {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rk-nav-item {
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(10, 16, 24, 0.74);
  color: rgba(232, 237, 244, 0.86);
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  text-shadow: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.rk-nav-item:hover,
.rk-nav-item.active {
  color: var(--rk-gold);
  border-color: rgba(241, 189, 75, 0.72);
  background: radial-gradient(circle at 20% 50%, rgba(241, 189, 75, 0.14), rgba(10, 16, 24, 0.86));
}

.rk-content {
  min-width: 0;
  padding: 14px 12px 22px;
}

.rk-header {
  margin-bottom: 12px;
}

.rk-header h1 {
  display: none;
}

.rk-layout--full .rk-header h1 {
  left: 36px;
}

.rk-layout--full #clan-title {
  position: absolute;
  z-index: 2;
  left: 36px;
  top: 112px;
  justify-content: flex-start;
}

.rk-layout--full #clan-head-meta {
  position: absolute !important;
  z-index: 2;
  left: 36px;
  top: 166px;
  justify-content: flex-start !important;
  color: rgba(255, 255, 255, .82) !important;
  font-size: 14px !important;
}

.rk-cols,
.rk-row {
  display: grid;
  grid-template-columns: 42px 200px 1fr 160px 170px;
  align-items: center;
  gap: 10px;
}

.c-status {
  display: flex;
  justify-content: center;
  align-items: center;
}

.c-status .status-indicator-gif {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
}

.rk-cols {
  padding: 0 16px 9px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
}

.rk-cols .c-player {
  padding-left: 66px;
}

.rk-list {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  display: grid;
  gap: 9px;
}

.rk-row {
  min-height: 62px;
  padding: 8px 16px;
  border: 1px solid rgba(65, 82, 100, 0.42);
  border-radius: 10px;
  background: #0b121a;
}

.rk-row:nth-child(odd) {
  background: #0b121a;
}

.rk-row:hover {
  border-color: rgba(241, 189, 75, 0.28);
  background: #101821;
}

.rk-row:last-child {
  border-bottom: 1px solid rgba(65, 82, 100, 0.42);
}

.c {
  min-width: 0;
}

.c-score,
.c-month {
  color: #f5d47d;
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
}

.rk-rank {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #1a2a38;
  color: #d9e4ef;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 400;
}

.rk-rank.r1,
.rk-rank.r2,
.rk-rank.r3 {
  color: #111922;
}

.rk-rank.r1 {
  background: linear-gradient(180deg, #ffe47d, #f2ba3d);
}

.rk-rank.r2 {
  background: linear-gradient(180deg, #f5f8fb, #b7c1cc);
}

.rk-rank.r3 {
  background: linear-gradient(180deg, #ffd29c, #db8739);
}

.c-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.rk-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.rk-ico {
  width: 27px;
  height: 27px;
  object-fit: contain;
  filter: none;
}

.rk-ico--nav {
  width: 28px;
  height: 28px;
}

.rk-class,
.rk-nation,
.rk-clan {
  width: 28px;
  height: 28px;
}

.rk-clan {
  border-radius: 5px;
}

.rk-player {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(0);
}

.rk-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  line-height: 1.1;
}

.rk-name,
.rk-clan-link,
.rk-leader-link {
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  text-shadow: none;
}

.rk-name:hover,
.rk-clan-link:hover,
.rk-leader-link:hover {
  color: var(--rk-gold);
}

.rk-name {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.rk-meta {
  margin-top: 2px;
  display: flex;
  gap: 7px;
  color: var(--rk-muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.rk-meta .rk-clan {
  width: auto;
  height: auto;
  max-width: 130px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-meta .rk-level {
  flex: 0 0 auto;
  white-space: nowrap;
}

.rk-tier {
  width: 16px;
  height: 16px;
  margin-top: 0;
  object-fit: contain;
  flex: 0 0 16px;
}

.rk-badge {
  color: var(--rk-gold);
  margin-right: 4px;
}

@media (max-width: 1100px) {
  .rk-layout {
    grid-template-columns: 1fr;
  }

  .rk-header h1,
  .rk-layout--full #clan-title {
    left: 28px;
  }

  .rk-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(241, 189, 75, 0.14);
  }

  .rk-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rk-nav--filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .rk-inner {
    width: min(100% - 24px, 1200px);
  }

  .rk-layout::before {
    min-height: 190px;
  }

  .rk-hero-copy {
    padding: 28px 22px 26px;
  }

  .rk-breadcrumb {
    margin-bottom: 22px;
    font-size: 11px;
  }

  .rk-hero-copy h1 {
    font-size: 30px;
  }

  .rk-hero-copy p {
    font-size: 13px;
  }

  .rk-header h1,
  .rk-layout--full .rk-header h1,
  .rk-layout--full #clan-title {
    left: 22px;
    top: 92px;
    font-size: 28px;
  }

  .rk-layout--full #clan-head-meta {
    left: 22px;
    top: 132px;
    font-size: 11px !important;
    gap: 8px !important;
    flex-wrap: wrap;
  }

  .rk-nav,
  .rk-nav--filters {
    grid-template-columns: 1fr;
  }

  .rk-cols {
    display: none;
  }

  .rk-row {
    grid-template-columns: 42px 1fr;
  }
  .c-status {
    display: none !important;
  }

  .c-score,
  .c-month {
    grid-column: 2;
    text-align: left;
  }
}

/* ===== Ranking Page Top 3 Row Highlights ===== */
.rk-row--rank-1 {
  background: linear-gradient(90deg, rgba(241, 189, 75, 0.12) 0%, rgba(11, 18, 26, 0.4) 100%) !important;
  border-color: rgba(241, 189, 75, 0.38) !important;
}
.rk-row--rank-1:hover {
  background: linear-gradient(90deg, rgba(241, 189, 75, 0.2) 0%, rgba(11, 18, 26, 0.6) 100%) !important;
  border-color: rgba(241, 189, 75, 0.58) !important;
}
.rk-row--rank-1 .rk-rank.r1 {
  box-shadow: 0 0 12px rgba(241, 189, 75, 0.45);
}

.rk-row--rank-2 {
  background: linear-gradient(90deg, rgba(183, 193, 204, 0.08) 0%, rgba(11, 18, 26, 0.4) 100%) !important;
  border-color: rgba(183, 193, 204, 0.32) !important;
}
.rk-row--rank-2:hover {
  background: linear-gradient(90deg, rgba(183, 193, 204, 0.15) 0%, rgba(11, 18, 26, 0.6) 100%) !important;
  border-color: rgba(183, 193, 204, 0.5) !important;
}
.rk-row--rank-2 .rk-rank.r2 {
  box-shadow: 0 0 12px rgba(183, 193, 204, 0.35);
}

.rk-row--rank-3 {
  background: linear-gradient(90deg, rgba(219, 135, 57, 0.07) 0%, rgba(11, 18, 26, 0.4) 100%) !important;
  border-color: rgba(219, 135, 57, 0.3) !important;
}
.rk-row--rank-3:hover {
  background: linear-gradient(90deg, rgba(219, 135, 57, 0.14) 0%, rgba(11, 18, 26, 0.6) 100%) !important;
  border-color: rgba(219, 135, 57, 0.48) !important;
}
.rk-row--rank-3 .rk-rank.r3 {
  box-shadow: 0 0 12px rgba(219, 135, 57, 0.35);
}

/* ===== Level Ranking Layout & Progress Bar ===== */
.rk-layout--level .rk-cols,
.rk-layout--level .rk-row {
  grid-template-columns: 42px 90px 180px 180px 120px 1fr;
}

.c-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c-player-name a.rk-name {
  font-size: 15px;
  font-weight: 500;
}

.c-clan-name,
.c-level {
  text-align: center;
}

.c-clan-name .clan-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.c-clan-name .clan-wrapper img.rk-clan {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.c-clan-name a.rk-clan-link {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff !important;
  text-shadow: none;
  text-decoration: none;
  transition: color 0.18s ease;
}

.c-clan-name a.rk-clan-link:hover {
  color: var(--rk-gold) !important;
}

.c-clan-name .no-clan-text {
  font-size: 13px;
  color: rgba(232, 237, 244, 0.38) !important;
}

.c-level {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
}

.c-xp {
  display: flex;
  justify-content: center;
  align-items: center;
}

.xp-bar-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 220px;
}

.xp-bar-bg {
  width: 100%;
  height: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.xp-bar-fill {
  height: 100%;
  background: #c69b40;
  border-radius: 9px;
  box-shadow: none;
  width: 0%;
}

.xp-percent-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  font-family: monospace;
  line-height: 1;
}

@media (max-width: 820px) {
  .rk-layout--level .rk-row {
    grid-template-columns: 42px 1fr;
    gap: 8px 12px;
    padding: 14px 16px;
  }
  
  .rk-layout--level .c-icons,
  .rk-layout--level .c-player-name,
  .rk-layout--level .c-clan-name,
  .rk-layout--level .c-level,
  .rk-layout--level .c-xp {
    grid-column: 2;
  }
  
  .xp-bar-container {
    max-width: 100%;
  }
}

/* ===== Clan Ranking 5-Column Grid Layout ===== */
.rk-layout--clan .rk-cols,
.rk-layout--clan .rk-row {
  grid-template-columns: 42px minmax(220px, 1fr) 150px 150px 150px;
}

.c-donated {
  color: #f5d47d;
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .rk-layout--clan .rk-row {
    grid-template-columns: 42px 1fr;
  }
  
  .rk-layout--clan .c-score,
  .rk-layout--clan .c-donated,
  .rk-layout--clan .c-month {
    grid-column: 2;
    text-align: left;
  }
}

/* ===== Clickable Sorting Headers ===== */
.rk-cols .sort-header {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.18s ease;
}

.rk-cols .sort-header:hover {
  color: var(--rk-gold);
}

.rk-cols .sort-header.active-sort {
  color: var(--rk-gold);
  font-weight: 700;
}
