/* ==========================================================================
   Лидерборд: полировка. Подключается ПОСЛЕДНИМ в leaderboard.html.
   Подиум «ступенями» (2 — 1 — 3), крупные пиксельные кубки со свечением и искрами,
   кнопка «Информация» — одна иконка.
   ========================================================================== */

html body.mc-page:not(.x) .podium {
  grid-template-columns: 1fr 1.18fr 1fr; gap: 22px; align-items: end; margin: 34px 0 10px;
}

/* ---------- Карточка подиума ---------- */
html body.mc-page:not(.x) .podium .podium-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 26px 18px 24px; border-top: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 14%, #2b2b2b) 0%, #2b2b2b 62%);
  box-shadow: var(--mc-bevel), 0 14px 34px rgba(0, 0, 0, .4);
}
html body.mc-page:not(.x) .podium .place-1 { --pc: #f5c518; min-height: 372px; padding-top: 30px; }
html body.mc-page:not(.x) .podium .place-2 { --pc: #c9cdd6; min-height: 322px; }
html body.mc-page:not(.x) .podium .place-3 { --pc: #cd7f4a; min-height: 298px; }
html body.mc-page:not(.x) .podium .podium-card::before {       /* цветная полоса места */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--pc); z-index: 1;
}
html body.mc-page:not(.x) .podium .podium-card::after {        /* пиксельная «шторка» света сверху */
  content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 120px; pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 50% 0, color-mix(in srgb, var(--pc) 26%, transparent), transparent 75%);
}

/* ---------- Кубок: крупный, со свечением ---------- */
html body.mc-page:not(.x) .podium .trophy-wrap {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 130px; height: 130px; margin-bottom: 4px;
}
html body.mc-page:not(.x) .podium .place-1 .trophy-wrap { width: 168px; height: 168px; }
html body.mc-page:not(.x) .podium .trophy-wrap::before {       /* ореол за кубком */
  content: ''; position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pc) 42%, transparent) 0%, transparent 68%);
  animation: lb-glow 3.4s ease-in-out infinite;
}
html body.mc-page:not(.x) .podium .trophy {
  position: relative; display: block; width: 91px; height: 105px;      /* 13x15 клеток по 7px */
  image-rendering: pixelated; pointer-events: none;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .5));
}
html body.mc-page:not(.x) .podium .place-1 .trophy { width: 117px; height: 135px; animation: lb-float 3.4s ease-in-out infinite; }  /* по 9px */
@keyframes lb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes lb-glow  { 0%, 100% { opacity: .75; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.08); } }

/* Искры у золотого кубка: пиксельные «плюсы» мерцают по очереди */
html body.mc-page:not(.x) .podium .spark {
  position: absolute; z-index: 3; width: 5px; height: 5px; color: #fff3b0; background: currentColor;
  box-shadow: 0 -10px currentColor, 0 10px currentColor, -10px 0 currentColor, 10px 0 currentColor;
  opacity: 0; animation: lb-twinkle 2.6s ease-in-out infinite;
}
html body.mc-page:not(.x) .podium .spark.s1 { left: 10%; top: 18%; }
html body.mc-page:not(.x) .podium .spark.s2 { right: 8%; top: 34%; animation-delay: .9s; color: #ffd84a; }
html body.mc-page:not(.x) .podium .spark.s3 { left: 20%; bottom: 14%; animation-delay: 1.7s; }
@keyframes lb-twinkle {
  0%, 60%, 100% { opacity: 0; transform: scale(.3); }
  75%           { opacity: 1; transform: scale(1); }
}

/* ---------- Текст ---------- */
html body.mc-page:not(.x) .podium .rank {
  position: relative; z-index: 2; padding: 4px 14px 5px; line-height: 1;
  color: #1c1c1c; background: var(--pc); text-shadow: none; font-size: 22px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .45), inset -2px -2px 0 rgba(0, 0, 0, .28), 0 0 0 2px #000;
}
html body.mc-page:not(.x) .podium .name { position: relative; z-index: 2; max-width: 100%; margin: 6px 0 0; font-size: 24px; }
html body.mc-page:not(.x) .podium .place-1 .name { font-size: 28px; }
html body.mc-page:not(.x) .podium .name a { max-width: 100%; gap: 10px; }
html body.mc-page:not(.x) .podium .name .nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body.mc-page:not(.x) .podium .name .avatar-head.sm { flex: none; width: 28px; height: 28px; outline: 2px solid #121212; }
html body.mc-page:not(.x) .podium .score { position: relative; z-index: 2; margin: 0 0 6px; font-size: 18px; color: var(--pc); opacity: 1; }
html body.mc-page:not(.x) .podium .chips { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---------- Свободное место ---------- */
html body.mc-page:not(.x) .podium .ghost { background: transparent; box-shadow: inset 0 0 0 2px #2f2f2f; border-style: dashed; }
html body.mc-page:not(.x) .podium .ghost::before, html body.mc-page:not(.x) .podium .ghost::after { display: none; }
html body.mc-page:not(.x) .podium .ghost .trophy { filter: grayscale(1) brightness(.6); opacity: .22; animation: none; }
html body.mc-page:not(.x) .podium .ghost .trophy-wrap::before { display: none; }
html body.mc-page:not(.x) .podium .ghost .rank { background: #333; color: #777; box-shadow: 0 0 0 2px #000; }
html body.mc-page:not(.x) .podium .ghost .name { font-size: 16px; opacity: .5; }

/* ---------- Кнопка «Информация» — одна иконка ---------- */
html body.mc-page:not(.x) .btn.btn-icon {
  width: 44px; height: 44px; padding: 0; margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; color: #d8d8d8;
}
html body.mc-page:not(.x) .btn.btn-icon svg { width: 18px; height: 24px; display: block; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .5)); }
html body.mc-page:not(.x) .btn.btn-icon:hover { color: #fff; }

/* ---------- Мобильные ---------- */
@media (max-width: 760px) {
  html body.mc-page:not(.x) .podium { grid-template-columns: 1fr; gap: 16px; }
  html body.mc-page:not(.x) .podium .podium-card { min-height: 0 !important; }
  html body.mc-page:not(.x) .podium .place-1 { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  html body.mc-page:not(.x) .podium .trophy, html body.mc-page:not(.x) .podium .trophy-wrap::before, html body.mc-page:not(.x) .podium .spark { animation: none; }
}


/* ---------- Список лидерборда: без проявления «по прокрутке» ----------
   Раньше строки ниже экрана были невидимы, пока до них не доскроллишь (пустое место внизу, строки выскакивали
   рывками). Теперь все строки есть сразу, а при загрузке плавно появляются каскадом (первые ~14, остальные вместе). */
@media (prefers-reduced-motion: no-preference) {
  html.mo-on #list[data-no-motion] .leader-row,
  html #list[data-no-motion] .leader-row {
    animation: lb-row-in .5s cubic-bezier(.22, .8, .24, 1) both !important;
    animation-delay: calc(min(var(--i, 0), 14) * 30ms) !important;
  }
}
@keyframes lb-row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#list[data-no-motion] .leader-row { min-height: 56px; }   /* высота не прыгает, пока грузится аватарка */


/* ==========================================================================
   Список лидерборда v2: шире, очки под ником пилюлей, справа ровные мини-карточки режимов
   (иконка кита + тир). Режимы всегда в одном порядке, пустой слот — «—», поэтому колонки выровнены.
   ========================================================================== */
html body.lb-page .container { max-width: 1240px; }

html body.lb-page:not(.x) #list.card { padding: 10px 22px; }
html body.lb-page:not(.x) .leader-row {
  position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 84px; padding: 10px 14px; margin: 0 -14px;
}
/* место: крупная пиксельная плашка */
html body.lb-page:not(.x) .leader-row .rank {
  box-sizing: border-box; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; gap: 1px;
  font-family: 'Minecraft', monospace !important; font-size: 22px; font-weight: 400; line-height: 1; color: #f0f0f3;
  background: linear-gradient(180deg, #2a2a2f, #202024); border-radius: 12px; box-shadow: inset 0 0 0 1px #34343a, 0 2px 0 rgba(0, 0, 0, .35);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
}
html body.lb-page:not(.x) .leader-row .rank i { font-style: normal; font-size: 14px; color: #80808a; margin-right: 1px; }
html body.lb-page:not(.x) .leader-row .rank.top10 { color: #fff; background: linear-gradient(180deg, #3a3320, #26231a); box-shadow: inset 0 0 0 1px rgba(245, 197, 24, .45), 0 2px 0 rgba(0, 0, 0, .35); }
html body.lb-page:not(.x) .leader-row .rank.top10 i { color: #c9a21a; }

/* ник + очки */
html body.lb-page:not(.x) .leader-row .lb-player { display: flex; align-items: center; gap: 14px; min-width: 0; flex: none; }
html body.lb-page:not(.x) .leader-row .lb-player .avatar-head { flex: none; width: 46px; height: 46px; border-radius: 10px; }
html body.lb-page:not(.x) .lb-who { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
html body.lb-page:not(.x) .lb-who .nick { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 700; line-height: 1.1; }
html body.lb-page:not(.x) .lb-pts {
  display: inline-flex; align-items: baseline; gap: 4px; line-height: 1; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: #7d7d86;
}
html body.lb-page:not(.x) .lb-pts b { font-size: 12px; font-weight: 600; color: #a4a4ad; font-variant-numeric: tabular-nums; }

/* мини-карточки режимов */
html body.lb-page:not(.x) .lb-cards { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 8px; }
html body.lb-page:not(.x) .lb-card {
  --mc: 160, 160, 170;
  position: relative; box-sizing: border-box; flex: none; width: 66px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, rgba(var(--mc), .26), rgba(var(--mc), .10)), #1c1c1f;
  box-shadow: inset 0 0 0 1px rgba(var(--mc), .38);
  transition: transform .18s ease, box-shadow .18s ease;
}
html body.lb-page:not(.x) .lb-card.m-op    { --mc: 245, 197, 24; }    /* OP — жёлтый */
html body.lb-page:not(.x) .lb-card.m-sword { --mc: 34, 211, 238; }   /* Sword — бирюзовый */
html body.lb-page:not(.x) .lb-card.m-npot  { --mc: 244, 63, 94; }    /* NPot — красный */
html body.lb-page:not(.x) .lb-card.m-mace  { --mc: 167, 139, 250; }  /* MACE — фиолетовый */
html body.lb-page:not(.x) .lb-card img { display: block; width: 36px; height: 36px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45)); }
html body.lb-page:not(.x) .lb-card b { font-size: 13px; font-weight: 800; line-height: 1; letter-spacing: .02em; color: #f4f4f6; }
html body.lb-page:not(.x) .lb-card .lb-ic-txt { font-style: normal; font-size: 11px; font-weight: 800; opacity: .8; }
/* HT ярче и с «свечением», LT спокойнее — тир читается с первого взгляда */
html body.lb-page:not(.x) .lb-card.t-ht { background: linear-gradient(180deg, rgba(var(--mc), .46), rgba(var(--mc), .16)), #1c1c1f; box-shadow: inset 0 0 0 1px rgba(var(--mc), .75), 0 0 14px rgba(var(--mc), .22); }
html body.lb-page:not(.x) .lb-card.t-lt b { color: #d6d6dc; }
html body.lb-page:not(.x) .lb-card.empty { background: #19191b; box-shadow: inset 0 0 0 1px #262629; }
html body.lb-page:not(.x) .lb-card.empty img { filter: grayscale(1) brightness(.6); opacity: .28; }
html body.lb-page:not(.x) .lb-card.empty b { color: #4a4a50; }
html body.lb-page:not(.x) .leader-row:hover .lb-card:not(.empty) { transform: translateY(-2px); }

/* карточки на подиуме — поменьше, по центру */
html body.lb-page:not(.x) .podium .lb-cards { position: relative; z-index: 2; justify-content: center; margin-top: 4px; }
html body.lb-page:not(.x) .podium .lb-card.sm { width: 58px; height: 56px; border-radius: 10px; gap: 1px; }
html body.lb-page:not(.x) .podium .lb-card.sm img { width: 32px; height: 32px; }
html body.lb-page:not(.x) .podium .lb-card.sm b { font-size: 12px; }

/* планшет / телефон: карточки уходят второй строкой на всю ширину */
@media (max-width: 760px) {
  html body.lb-page .container { padding-left: 14px; padding-right: 14px; }
  html body.lb-page:not(.x) .leader-row { grid-template-columns: 46px minmax(0, 1fr); row-gap: 10px; min-height: 0; padding: 12px 10px; }
  html body.lb-page:not(.x) .leader-row .lb-cards { grid-column: 1 / -1; justify-content: stretch; }
  html body.lb-page:not(.x) .leader-row .lb-card { flex: 1 1 0; width: auto; height: 56px; }
  html body.lb-page:not(.x) .leader-row .lb-player .avatar-head { width: 40px; height: 40px; }
  html body.lb-page:not(.x) .leader-row .rank { width: 44px; height: 44px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { html body.lb-page:not(.x) .lb-card { transition: none; } }
