/* Лидерборд: подиум 2–1–3 v3 (как на референсе): три карточки ОДНОГО размера и одной раскладки —
   текст слева, крупный рендер «по пояс» справа. Низ рендера обрезает карточка, у 1-го места рендер крупнее и выпирает вверх. */
html body.lb-page:not(.x) .podium {
  --pod-h: 300px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: end;
  margin: 140px 0 14px;                          /* запас сверху под выступающий рендер 1-го места */
}
html body.lb-page:not(.x) .podium .podium-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; text-align: left;
  overflow: visible !important; height: var(--pod-h); min-height: var(--pod-h) !important; padding: 22px 22px 22px;
}
html body.lb-page:not(.x) .podium .podium-card.ghost { align-items: center; justify-content: center; text-align: center; }
html body.lb-page:not(.x) .podium .podium-card::after { border-radius: 20px 20px 0 0; }

/* левая колонка: место, ник, очки, тиры */
html body.lb-page:not(.x) .podium .pm-info, html body.lb-page:not(.x) .podium .lb-cards { position: relative; z-index: 3; max-width: 52%; }
html body.lb-page:not(.x) .podium .pm-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
html body.lb-page:not(.x) .podium .name { max-width: 100%; margin: 4px 0 0; font-size: 24px; }
html body.lb-page:not(.x) .podium .place-1 .name { font-size: 26px; }
html body.lb-page:not(.x) .podium .name a { display: block; overflow-wrap: anywhere; line-height: 1.1; }
html body.lb-page:not(.x) .podium .name .nick { overflow: visible; text-overflow: clip; white-space: normal; }
html body.lb-page:not(.x) .podium .score { margin: 0; }
html body.lb-page:not(.x) .podium .lb-cards { justify-content: flex-start; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
html body.lb-page:not(.x) .podium .lb-card.sm { width: 52px; height: 52px; }

/* кубок — в левом верхнем углу карточки (у всех одинаково) */
html body.lb-page:not(.x) .podium .trophy-wrap, html body.lb-page:not(.x) .podium .place-2 .trophy-wrap { top: 16px; left: 18px; right: auto; }

/* рендер: справа, прижат к низу карточки; всё, что ниже карточки, срезается; вверх и вбок выступать можно */
html body.lb-page:not(.x) .podium .pm-fig {
  position: absolute; z-index: 1; right: -36px; bottom: 0; left: auto; width: auto; height: 390px; aspect-ratio: 380 / 420; margin: 0;
  clip-path: inset(-400px -400px 0 -400px);
}
html body.lb-page:not(.x) .podium .place-1 .pm-fig { right: -70px; height: 470px; }
html body.lb-page:not(.x) .podium .pm-fig img { object-fit: contain; object-position: bottom; filter: drop-shadow(0 10px 16px rgba(0,0,0,.55)); }
html body.lb-page:not(.x) .podium .podium-card:hover .pm-fig img { transform: translateY(-6px) scale(1.025); }

/* ---------- планшет ---------- */
@media (max-width: 1020px) {
  html body.lb-page:not(.x) .podium { --pod-h: 280px; gap: 14px; margin-top: 120px; }
  html body.lb-page:not(.x) .podium .podium-card { padding: 18px 14px; }
  html body.lb-page:not(.x) .podium .pm-fig { height: 330px; right: -34px; }
  html body.lb-page:not(.x) .podium .place-1 .pm-fig { height: 400px; right: -56px; }
  html body.lb-page:not(.x) .podium .name, html body.lb-page:not(.x) .podium .place-1 .name { font-size: 19px; }
  html body.lb-page:not(.x) .podium .lb-card.sm { width: 46px; height: 46px; }
}

/* ---------- телефон: карточки друг под другом, рендер сверху по центру и выпирает вверх ---------- */
@media (max-width: 760px) {
  html body.lb-page:not(.x) .podium { --pod-h: auto; grid-template-columns: 1fr; gap: 110px; margin-top: 110px; }
  html body.lb-page:not(.x) .podium .place-1 { order: -1; }
  html body.lb-page:not(.x) .podium .podium-card, html body.lb-page:not(.x) .podium .podium-card.ghost {
    height: auto; min-height: 0 !important; align-items: center; text-align: center; padding-top: 230px;
  }
  html body.lb-page:not(.x) .podium .pm-fig, html body.lb-page:not(.x) .podium .place-1 .pm-fig { right: auto; left: 50%; transform: translateX(-50%); height: 330px; top: -90px; bottom: auto; clip-path: none; }
  html body.lb-page:not(.x) .podium .pm-info { align-items: center; max-width: 100%; }
  html body.lb-page:not(.x) .podium .lb-cards { justify-content: center; max-width: 100%; }
}

/* ===== v3: 3D-рендер подиума (тот же Three.js-вьюер, что в профиле) ===== */
/* левая колонка: ник в одну строку, плитки тиров всегда в один ряд и не лезут под рендер */
html body.lb-page:not(.x) .podium .pm-info { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; max-width: 58%; }
html body.lb-page:not(.x) .podium .name { max-width: 100%; margin: 2px 0 0; font-size: 22px; }
html body.lb-page:not(.x) .podium .place-1 .name { font-size: 22px; }
html body.lb-page:not(.x) .podium .name a { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; line-height: 1.2; }
html body.lb-page:not(.x) .podium .name .nick { display: inline; overflow: visible; text-overflow: clip; white-space: nowrap; }
html body.lb-page:not(.x) .podium .lb-cards { position: relative; z-index: 3; justify-content: flex-start; flex-wrap: nowrap; gap: 6px; margin-top: 12px; }
html body.lb-page:not(.x) .podium .lb-card.sm { flex: none; width: 48px; height: 50px; }

/* контейнер рендера: справа, прижат к низу карточки; ниже карточки срезается, вверх/вбок выступать можно */
html body.lb-page:not(.x) .podium .podium-card .pm-fig {
  position: absolute; z-index: 1; right: -58px; bottom: 0; left: auto; top: auto; width: auto; height: 400px; aspect-ratio: 440 / 460; margin: 0;
  clip-path: inset(-500px -500px 0 -500px); pointer-events: none;
}
html body.lb-page:not(.x) .podium .podium-card.place-1 { z-index: 5; }
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: -84px; height: 500px; }
html body.lb-page:not(.x) .podium .pm3d { position: absolute; inset: 0; display: block; }
html body.lb-page:not(.x) .podium .pm3d > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
html body.lb-page:not(.x) .podium .pm3d.has-3d > img { display: none; }
html body.lb-page:not(.x) .podium .pm3d-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)) drop-shadow(0 0 28px color-mix(in srgb, var(--pc, #f5c518) 30%, transparent));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
html body.lb-page:not(.x) .podium .podium-card:hover .pm3d-canvas { transform: translateY(-6px) scale(1.03); }
html body.lb-page:not(.x) .podium .podium-card.place-1 { --pc: #f5c518; }
html body.lb-page:not(.x) .podium .podium-card.place-2 { --pc: #c9cdd6; }
html body.lb-page:not(.x) .podium .podium-card.place-3 { --pc: #cd7f4a; }

@media (max-width: 1020px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig { height: 320px; right: -44px; }
  html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 400px; right: -66px; }
  html body.lb-page:not(.x) .podium .lb-card.sm { width: 42px; height: 44px; }
}
@media (max-width: 760px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig, html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: auto; left: 50%; transform: translateX(-50%); height: 330px; top: -90px; bottom: auto; clip-path: none; }
  html body.lb-page:not(.x) .podium .pm-info { max-width: 100%; align-items: center; }
  html body.lb-page:not(.x) .podium .lb-cards { justify-content: center; }
}

/* v3.1: рендер шире — предметы (мечи, щит) должны помещаться в кадр */
html body.lb-page:not(.x) .podium .podium-card .pm-fig { aspect-ratio: 520 / 460; right: -96px; }
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { aspect-ratio: 560 / 500; right: -130px; height: 520px; }
@media (max-width: 1020px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig { right: -80px; }
  html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: -104px; height: 420px; }
}
@media (max-width: 760px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig, html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: auto; }
}

/* v3.2: предметов нет — кадр снова компактный */
html body.lb-page:not(.x) .podium .podium-card .pm-fig { aspect-ratio: 440 / 460; right: -62px; }
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { aspect-ratio: 460 / 480; right: -86px; height: 500px; }
@media (max-width: 1020px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig { right: -48px; }
  html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: -66px; height: 400px; }
}
@media (max-width: 760px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig, html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: auto; }
}

/* v3.3: рендер меньше и дальше вправо — не закрывает ник, очки и плитки тиров */
html body.lb-page:not(.x) .podium .podium-card .pm-fig { height: 330px; right: -84px; aspect-ratio: 440 / 460; }
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 400px; right: -128px; aspect-ratio: 440 / 460; }
@media (max-width: 1020px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig { height: 270px; right: -64px; }
  html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 330px; right: -92px; }
}
@media (max-width: 760px) {
  html body.lb-page:not(.x) .podium .podium-card .pm-fig, html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: auto; height: 330px; }
}

/* v3.4: №1 компактнее и левее — руки не залезают на соседние карточки и на ник */
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 350px; right: -80px; }
@media (max-width: 1020px) { html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 290px; right: -60px; } }
@media (max-width: 760px) { html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 330px; right: auto; } }

/* v3.5: правка по скрину — №2 не упирается рукой в карточку №1, у №1 ник не касается руки */
html body.lb-page:not(.x) .podium .podium-card.place-2 .pm-fig { right: -62px; }
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { right: -92px; }
html body.lb-page:not(.x) .podium .place-1 .name { font-size: 20px; }
html body.lb-page:not(.x) .podium .pm-info { max-width: 54%; }
@media (max-width: 760px) { html body.lb-page:not(.x) .podium .podium-card .pm-fig { right: auto; } html body.lb-page:not(.x) .podium .pm-info { max-width: 100%; } }

/* v3.6: №1 — поза с поднятой рукой, кадр шире */
html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 385px; right: -96px; }
@media (max-width: 1020px) { html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 320px; right: -72px; } }
@media (max-width: 760px) { html body.lb-page:not(.x) .podium .podium-card.place-1 .pm-fig { height: 360px; right: auto; } }

/* v3.7: 3D-канвас плавно появляется, когда готов (без мигания старых картинок) */
html body.lb-page:not(.x) .podium .pm3d-canvas { opacity: 0; transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
html body.lb-page:not(.x) .podium .pm3d.has-3d .pm3d-canvas { opacity: 1; }

/* v3.8: список (4+) — плитки тиров прижаты к правому краю строки, ник и очки слева (как на макете) */
@media (min-width: 761px) {
  html body.lb-page:not(.x) .leader-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; }
  html body.lb-page:not(.x) .leader-row .lb-player { min-width: 0; justify-self: start; }
  html body.lb-page:not(.x) .leader-row .lb-cards { justify-self: end; margin-left: auto; justify-content: flex-end; flex-wrap: nowrap; }
}
