.ranking-page {
  min-height: 100vh;
  background-color: #071433;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(56, 189, 248, 0.22), transparent 55%),
    linear-gradient(165deg, #06102c 0%, #0a1a44 50%, #071433 100%);
  overflow-x: hidden;
}

.ranking-page__shapes {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.ranking-page__shapes::before,
.ranking-page__shapes::after {
  content: "";
  position: absolute;
  width: 42vw;
  max-width: 28rem;
  height: 42vw;
  max-height: 28rem;
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 55%, #1e3a8a 100%);
  opacity: 0.85;
  filter: drop-shadow(0 0 28px rgba(56, 189, 248, 0.35));
}

.ranking-page__shapes::before {
  top: -12%;
  right: -10%;
  clip-path: polygon(18% 0, 100% 0, 100% 78%, 62% 100%, 0 42%);
}

.ranking-page__shapes::after {
  left: -12%;
  bottom: -16%;
  clip-path: polygon(0 28%, 48% 0, 100% 38%, 72% 100%, 0 100%);
  background: linear-gradient(160deg, #67e8f9 0%, #2563eb 45%, #0f172a 100%);
}

.ranking-page__nav {
  padding: 1.25rem 1rem 0.4rem;
}

.ranking-page .user-bar a {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #e0f2fe;
  font-weight: 800;
  font-size: 0.8rem;
}

.ranking-page .user-bar a:hover {
  background: rgba(56, 189, 248, 0.32);
}

.ranking__tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  max-width: 44rem;
  margin: 0.35rem auto 0.85rem;
  padding: 0.15rem 1rem 0.55rem;
  scrollbar-width: thin;
}

.ranking__tab {
  flex: 0 0 auto;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 0.38rem 0.78rem;
  background: rgba(8, 24, 58, 0.78);
  color: #bfdbfe;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ranking__tab:hover,
.ranking__tab:focus-visible {
  border-color: rgba(125, 211, 252, 0.7);
  color: #f8fafc;
  outline: none;
}

.ranking__tab.is-active {
  background: linear-gradient(180deg, #67e8f9, #38bdf8);
  border-color: #7dd3fc;
  color: #082f49;
}

.lb {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.5rem 1.15rem 3.2rem;
}

.lb__card {
  position: relative;
  padding: 2.4rem 1.15rem 1.15rem;
  border-radius: 2.2rem;
  background:
    linear-gradient(180deg, rgba(14, 42, 96, 0.55), rgba(8, 24, 58, 0.35)) padding-box,
    linear-gradient(180deg, #7dd3fc, #2563eb) border-box;
  border: 3px solid transparent;
  box-shadow:
    0 0 0 1px rgba(125, 211, 252, 0.25),
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(186, 230, 253, 0.25);
}

.lb__card::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border-radius: 1.7rem;
  border: 2px solid rgba(125, 211, 252, 0.28);
  pointer-events: none;
}

.lb__badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -52%);
  margin: 0;
  min-width: 11.5rem;
  padding: 0.42rem 1.35rem 0.48rem;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #0b2a62 0%, #12357a 100%);
  border: 3px solid #7dd3fc;
  box-shadow:
    0 0 22px rgba(56, 189, 248, 0.45),
    inset 0 1px 0 rgba(186, 230, 253, 0.35);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(1.05rem, 3.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e0f2fe;
  text-align: center;
  white-space: nowrap;
}

.lb__hint {
  margin: 0.35rem 0.4rem 0.85rem;
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.lb__list {
  margin: 0;
  padding: 0.15rem 0.15rem 0.35rem;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.lb__row {
  display: grid;
  grid-template-columns: 2.35rem 2.55rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.lb__medal,
.lb__pos {
  justify-self: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lb__pos {
  color: #e2e8f0;
  font-size: 1.05rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.lb__medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.78rem;
  z-index: 1;
}

.lb__medal::before,
.lb__medal::after {
  content: "";
  position: absolute;
  top: -0.42rem;
  width: 0.42rem;
  height: 0.72rem;
  z-index: -1;
  border-radius: 0 0 2px 2px;
}

.lb__medal::before {
  left: 0.18rem;
  transform: rotate(-22deg);
  background: #ef4444;
}

.lb__medal::after {
  right: 0.18rem;
  transform: rotate(22deg);
  background: #f87171;
}

.lb__medal--gold {
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 58%, #b45309);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
}

.lb__medal--silver {
  background: radial-gradient(circle at 35% 30%, #f8fafc, #94a3b8 58%, #475569);
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.45);
}

.lb__medal--bronze {
  background: radial-gradient(circle at 35% 30%, #fdba74, #c2410c 58%, #7c2d12);
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.4);
}

.lb__avatar {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #f1f5f9, #cbd5e1);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  color: #334155;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lb__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  padding: 0.35rem 0.85rem 0.35rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow:
    inset 0 1px 0 rgba(191, 219, 254, 0.35),
    0 4px 10px rgba(15, 23, 42, 0.28);
}

.lb__row.is-first .lb__bar {
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

.lb__row.is-me .lb__bar {
  box-shadow:
    inset 0 1px 0 rgba(191, 219, 254, 0.45),
    0 0 0 2px #fbbf24,
    0 4px 10px rgba(15, 23, 42, 0.28);
}

.lb__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.92rem;
}

.lb__stars {
  display: flex;
  gap: 0.08rem;
  font-size: 0.78rem;
  line-height: 1;
}

.lb__star {
  color: #60a5fa;
}

.lb__star.is-on {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.55);
}

.lb__score {
  color: #ffffff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
  min-width: 2.4rem;
  text-align: right;
}

.lb__empty {
  margin: 0.4rem 0 0.2rem;
  padding: 1rem 0.5rem;
  color: #93c5fd;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 560px) {
  .lb__card {
    padding: 2.3rem 0.7rem 0.9rem;
  }

  .lb__row {
    grid-template-columns: 1.9rem 2.15rem minmax(0, 1fr);
    gap: 0.3rem;
  }

  .lb__avatar {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.68rem;
  }

  .lb__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.32rem 0.7rem;
  }

  .lb__stars {
    display: none;
  }

  .lb__badge {
    min-width: 0;
    max-width: calc(100% - 2rem);
    padding: 0.38rem 0.85rem;
    font-size: 0.95rem;
    white-space: normal;
  }
}
