.rank-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background: #000;
  color: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.rank-page-overlay.is-open {
  display: flex;
  pointer-events: auto;
}

.rank-page {
  position: relative;
  width: 750px;
  height: 1650px;
  overflow: hidden;
  background: #a7e3f4;
  transform: scale(var(--rank-scale, 1));
  transform-origin: top center;
}

.rank-title {
  position: absolute;
  left: 0;
  top: 0;
  width: 750px;
  height: 96px;
  line-height: 96px;
  font-size: 44px;
  font-weight: 900;
  color: #2c77d6;
  text-align: center;
}

.rank-board {
  position: absolute;
  left: 28px;
  top: 104px;
  width: 694px;
  min-height: 1086px;
  padding: 22px 22px 26px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 14px;
}

.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: 132px 1fr 205px;
  align-items: center;
  box-sizing: border-box;
}

.rank-head {
  height: 48px;
  padding: 0 14px;
  font-size: 26px;
  font-weight: 900;
  color: #222;
}

.rank-rows {
  height: 646px;
  max-height: 646px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rank-rows::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rank-state {
  height: 646px;
  display: grid;
  place-items: center;
  color: #2c77d6;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.rank-row {
  height: 96px;
  margin-top: 14px;
  padding: 0 18px 0 9px;
  border: 3px solid #be88da;
  border-radius: 13px;
  font-size: 27px;
  font-weight: 900;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.42);
}

.rank-row.gold {
  background: linear-gradient(180deg, #ffe36b 0%, #ffc630 100%);
  border-color: #f09b31;
}

.rank-row.pink {
  background: linear-gradient(180deg, #ff9bc7 0%, #ef83bc 100%);
  border-color: #d66aae;
}

.rank-row.lilac {
  background: linear-gradient(180deg, #f1d9ff 0%, #dcc1f4 100%);
}

.rank-place {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.rank-medal {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 38px;
  line-height: 1;
  border: 6px solid #fff6b4;
  text-shadow: 0 3px 2px rgba(0, 0, 0, 0.28);
  box-shadow: 0 7px 0 rgba(133, 78, 34, 0.45);
}

.rank-1 {
  background: linear-gradient(180deg, #ffef54 0%, #f59b2a 100%);
}

.rank-2 {
  background: linear-gradient(180deg, #7bd2ff 0%, #3b75f3 100%);
}

.rank-3 {
  background: linear-gradient(180deg, #ffb45d 0%, #ec602d 100%);
}

.rank-player {
  min-width: 0;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 28px;
}

.rank-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 0 3px 2px rgba(0, 0, 0, 0.35);
}

.rank-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-avatar.a1 { background: linear-gradient(135deg, #203257, #d5a52e); }
.rank-avatar.a2 { background: linear-gradient(135deg, #10a6c8, #ff7a6d); }
.rank-avatar.a3 { background: radial-gradient(circle at 50% 45%, #f038af 0 28%, #8b1cc8 30% 64%, #f4c21b 66%); }
.rank-avatar.a4 { background: linear-gradient(135deg, #7fa66b, #efe7c6); color: #533; }
.rank-avatar.a5 { background: linear-gradient(135deg, #35362c, #9acb62); }
.rank-avatar.a6 { background: linear-gradient(135deg, #fff2f4, #ffd2dc); color: #d96a86; }

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name.hot {
  color: #ff3ee5;
}

.rank-name.green,
.rank-score.green {
  color: #35e430;
}

.rank-score {
  text-align: right;
  white-space: nowrap;
}

.rank-ad {
  width: calc(100% + 44px);
  height: 114px;
  margin: 22px -22px 0;
  padding: 0 28px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  background: linear-gradient(180deg, #ffb640 0%, #ff6b38 100%);
  color: #fff;
  font-size: 29px;
  font-weight: 900;
}

.rank-ad-card {
  justify-self: center;
  display: grid;
  grid-template-columns: 74px auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: #7c2b11;
  font-size: 20px;
  line-height: 1.15;
}

.rank-ad-icon {
  width: 72px;
  height: 72px;
  border-radius: 9px;
  background: #fff;
  color: #d58c00;
  display: grid;
  place-items: center;
  font-size: 38px;
  border: 3px solid rgba(255, 255, 255, 0.6);
}

.rank-tabs {
  width: 430px;
  height: 70px;
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 38px;
}

.rank-tab,
.rank-action {
  height: 70px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font: 900 30px/1 Arial, "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #31c8e9 0%, #1395c9 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 7px 0 rgba(11, 101, 139, 0.65);
}

.rank-tab.is-active {
  background: linear-gradient(180deg, #1bbcea 0%, #0879c9 100%);
}

.rank-note {
  height: 96px;
  line-height: 96px;
  font-size: 26px;
  color: #111;
  text-align: center;
}

.rank-actions {
  position: absolute;
  left: 82px;
  top: 1288px;
  width: 586px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 110px;
}

.rank-action.home {
  color: #513200;
  background: linear-gradient(180deg, #ffe85a 0%, #ffc52d 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 7px 0 #9a7500;
}

.rank-action.share {
  background: linear-gradient(180deg, #6eea42 0%, #26bc17 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 7px 0 #188d0d;
}
