:root {
  --bg: #10141f;
  --panel: rgba(24, 30, 44, 0.9);
  --panel-strong: rgba(18, 23, 35, 0.96);
  --text: #f4f7fb;
  --muted: #9aa8bb;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #f4cb67;
  --silver: #dce3ed;
  --bronze: #db9d6f;
  --sky: #5997b0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(89, 151, 176, 0.22), transparent 34%),
    radial-gradient(circle at bottom left, rgba(244, 203, 103, 0.12), transparent 28%),
    linear-gradient(180deg, #0d1119 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.ranking-page {
  padding: 28px 20px 40px;
}

.ranking-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.ranking-header {
  position: relative;
}

.ranking-header__shell {
  width: min(100%, 560px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(125, 120, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(31, 28, 43, 0.94) 0%, rgba(20, 19, 29, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 54px rgba(0, 0, 0, 0.26);
}

.ranking-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.ranking-brand__badge {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ranking-brand__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ranking-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ranking-link {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ranking-link--accent {
  color: #1b1711;
  background: linear-gradient(180deg, #ffd978 0%, #f4c95d 100%);
  border-color: transparent;
}

.ranking-modal[hidden] {
  display: none;
}

.ranking-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ranking-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 14, 0.68);
  backdrop-filter: blur(10px);
}

.ranking-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(125, 120, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(31, 28, 43, 0.98) 0%, rgba(20, 19, 29, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 34px 80px rgba(0, 0, 0, 0.38);
}

.ranking-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.ranking-modal__eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 203, 103, 0.88);
}

.ranking-modal__title {
  margin: 0;
  padding-right: 44px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.05em;
  color: #f7f8fb;
}

.ranking-modal__contacts {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.ranking-contact-card {
  padding: 18px 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ranking-contact-card__label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 203, 103, 0.84);
}

.ranking-contact-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.ranking-contact-card__meta {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.ranking-main {
  margin-top: 26px;
  display: grid;
  gap: 18px;
}

.ranking-hero,
.ranking-podium,
.ranking-list {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.ranking-hero {
  padding: 28px;
  background:
    radial-gradient(circle at top center, rgba(89, 151, 176, 0.16), transparent 42%),
    var(--panel);
}

.ranking-hero__eyebrow,
.ranking-section__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 203, 103, 0.88);
}

.ranking-hero__title,
.ranking-podium__header h2,
.ranking-list__header h2 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.ranking-hero__text {
  width: min(100%, 720px);
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.ranking-meta {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ranking-meta__card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ranking-meta__card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.ranking-meta__card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.ranking-podium__header,
.ranking-list__header {
  padding: 24px 24px 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.ranking-podium__header h2,
.ranking-list__header h2 {
  font-size: clamp(24px, 3.2vw, 34px);
}

.ranking-status,
.ranking-list__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.ranking-status[data-state="error"] {
  color: #ff9d93;
}

.ranking-status[data-state="success"] {
  color: #9fe0b7;
}

.ranking-status[data-state="pending"] {
  color: #d7dee8;
}

.ranking-podium {
  padding: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ranking-podium__shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 18px 24px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(125, 120, 255, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(31, 28, 43, 0.98) 0%, rgba(20, 19, 29, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 36px 80px rgba(0, 0, 0, 0.34);
}

.ranking-podium__grid {
  min-height: 434px;
  padding: 8px 4px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.podium-slot {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.podium-slot--gold {
  z-index: 3;
}

.podium-slot--empty {
  opacity: 0.62;
}

.podium-slot__player {
  width: 100%;
  margin-bottom: 16px;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.podium-slot__player--empty {
  gap: 10px;
}

.podium-slot__trophy {
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 12px 26px rgba(244, 203, 103, 0.3);
}

.podium-slot__name {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: #f8f9fc;
}

.podium-slot__name--empty {
  color: rgba(248, 249, 252, 0.62);
}

.podium-slot__name .ranking-name-inline {
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.podium-slot__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 700;
  color: #f0f2f7;
}

.podium-slot__chip--empty {
  color: rgba(240, 242, 247, 0.7);
  background: rgba(255, 255, 255, 0.03);
}

.podium-slot--gold .podium-slot__chip {
  color: #fff3c8;
  background: rgba(244, 203, 103, 0.08);
}

.podium-step {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(248, 248, 255, 0.46) 0%, rgba(255, 255, 255, 0.18) 15%, rgba(68, 67, 84, 0.96) 46%, rgba(18, 18, 27, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -18px 36px rgba(0, 0, 0, 0.22),
    0 28px 40px rgba(0, 0, 0, 0.28);
  clip-path: polygon(10% 0, 90% 0, 100% 13%, 100% 100%, 0 100%, 0 13%);
}

.podium-step::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12%;
  right: 12%;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.06) 100%);
  filter: blur(6px);
  opacity: 0.7;
}

.podium-slot--silver .podium-step {
  height: 164px;
}

.podium-slot--gold .podium-step {
  height: 224px;
}

.podium-slot--bronze .podium-step {
  height: 138px;
}

.podium-step__number {
  position: relative;
  z-index: 1;
  font-size: 74px;
  font-weight: 800;
  letter-spacing: -0.08em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 12px 24px rgba(0, 0, 0, 0.42);
}

.podium-slot--silver .podium-step__number,
.podium-slot--bronze .podium-step__number {
  font-size: 66px;
}

.ranking-name-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ranking-name-inline > span:last-child,
.ranking-name-inline strong {
  display: block;
}

.ranking-verified-badge {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #57b0ff;
}

.ranking-verified-badge svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(87, 176, 255, 0.2));
}

.ranking-status--podium {
  margin-top: 18px;
  text-align: center;
}

.ranking-podium__list {
  margin-top: 18px;
  padding-top: 18px;
}

.ranking-table {
  padding: 0;
}

.ranking-table__head,
.ranking-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
}

.ranking-table__head {
  padding: 18px 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ranking-row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.ranking-row--gold {
  color: #fff5d7;
}

.ranking-row--silver {
  color: #f4f7fb;
}

.ranking-row--bronze {
  color: #f7d0b2;
}

.ranking-row__rank {
  min-width: 54px;
  height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.ranking-row--gold .ranking-row__rank {
  color: #1e1810;
  background: linear-gradient(180deg, #ffe186 0%, #f4cb67 100%);
  border-color: rgba(244, 203, 103, 0.24);
}

.ranking-row--silver .ranking-row__rank {
  color: #18202c;
  background: linear-gradient(180deg, #f1f5fb 0%, #dce3ed 100%);
  border-color: rgba(220, 227, 237, 0.24);
}

.ranking-row--bronze .ranking-row__rank {
  color: #26170e;
  background: linear-gradient(180deg, #f4c8a7 0%, #db9d6f 100%);
  border-color: rgba(219, 157, 111, 0.24);
}

.ranking-row__name {
  display: grid;
  gap: 4px;
}

.ranking-row__name strong {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.ranking-row__name span {
  font-size: 13px;
  color: var(--muted);
}

.ranking-row__score {
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #d9eff8;
  background: rgba(89, 151, 176, 0.14);
  border: 1px solid rgba(89, 151, 176, 0.24);
}

.ranking-empty {
  padding: 22px 0 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 961px) {
  .ranking-header__shell {
    width: min(100%, 1040px);
  }

  .ranking-podium {
    padding: 4px 0 0;
  }

  .ranking-podium__shell {
    width: min(100%, 1040px);
    padding: 26px 28px 34px;
    border-radius: 48px;
  }

  .ranking-podium__grid {
    min-height: 590px;
    padding: 20px 22px 0;
    gap: 22px;
  }

  .podium-slot__player {
    margin-bottom: 22px;
    gap: 14px;
  }

  .podium-slot__trophy {
    font-size: 46px;
  }

  .podium-slot__name {
    min-height: 68px;
    font-size: 24px;
  }

  .podium-slot__name .ranking-name-inline {
    gap: 8px;
  }

  .podium-slot__chip {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 18px;
    font-size: 16px;
  }

  .podium-slot--silver .podium-step {
    height: 248px;
  }

  .podium-slot--gold .podium-step {
    height: 334px;
  }

  .podium-slot--bronze .podium-step {
    height: 208px;
  }

  .podium-step {
    border-radius: 28px 28px 0 0;
    clip-path: polygon(9% 0, 91% 0, 100% 10%, 100% 100%, 0 100%, 0 10%);
  }

  .podium-step::before {
    top: 16px;
    left: 10%;
    right: 10%;
    height: 32px;
  }

  .podium-step__number {
    font-size: 108px;
  }

  .podium-slot--silver .podium-step__number,
  .podium-slot--bronze .podium-step__number {
    font-size: 88px;
  }

  .ranking-status--podium {
    margin-top: 24px;
    font-size: 14px;
  }

  .ranking-podium__list {
    margin-top: 26px;
    padding-top: 24px;
  }
}

@media (max-width: 960px) {
  .ranking-header__shell,
  .ranking-list__header {
    flex-direction: column;
    align-items: stretch;
  }

  .ranking-meta {
    grid-template-columns: 1fr;
  }

  .ranking-header__actions {
    width: 100%;
  }

  .ranking-link {
    flex: 1 1 0;
  }
}

@media (max-width: 720px) {
  .ranking-page {
    padding: 22px 14px 34px;
  }

  .ranking-header__shell {
    padding: 16px;
    border-radius: 28px;
  }

  .ranking-modal {
    padding: 14px;
  }

  .ranking-modal__dialog {
    padding: 22px 18px 18px;
    border-radius: 26px;
  }

  .ranking-modal__title {
    font-size: 28px;
  }

  .ranking-contact-card strong {
    font-size: 19px;
  }

  .ranking-hero,
  .ranking-list__header,
  .ranking-table,
  .ranking-empty {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ranking-podium {
    padding: 0;
  }

  .ranking-podium__shell {
    width: 100%;
    padding: 16px 14px 22px;
    border-radius: 32px;
  }

  .ranking-podium__grid {
    min-height: 360px;
    padding-top: 10px;
    gap: 6px;
  }

  .podium-slot__name {
    min-height: 44px;
    font-size: 13px;
  }

  .podium-slot__chip {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .podium-slot--silver .podium-step {
    height: 134px;
  }

  .podium-slot--gold .podium-step {
    height: 182px;
  }

  .podium-slot--bronze .podium-step {
    height: 114px;
  }

  .podium-step__number {
    font-size: 54px;
  }

  .ranking-table__head {
    display: none;
  }

  .ranking-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .ranking-row__score {
    grid-column: 2 / 3;
    justify-self: start;
    margin-top: 10px;
  }
}
