/* ════════════════════════════════════════════════════
   LOADER + NAV
════════════════════════════════════════════════════ */

/* ── Lucky Drop Loader ──
   Без маскота: голографический диск (вращается только кольцо и блик —
   transform/opacity, без canvas и без RAF-циклов) + полоса-слайдер 0→100%.
   Прогресс задаётся переменной --ld-p (0..1) из инлайн-скрипта в index.html. */
#loader {
  position:fixed; inset:0; z-index:1000;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(60% 38% at 50% 38%, rgba(91,184,255,.13) 0%, transparent 70%),
    radial-gradient(ellipse 60% 34% at 50% 0%, rgba(120,60,255,.20) 0%, transparent 65%),
    radial-gradient(130% 90% at 50% 0%, #1a1035 0%, #0c0a1a 45%, #06060f 100%);
  transition:opacity .5s cubic-bezier(.4,0,.2,1), visibility .5s;
  overflow:hidden;
}
#loader.hidden { opacity:0; visibility:hidden; pointer-events:none; }
/* После скрытия ничего не крутим, даже пока идёт fade-out */
#loader.hidden .ld-disc-ring,
#loader.hidden .ld-disc-sheen,
#loader.hidden .ld-disc-halo { animation:none; }

.ld-content {
  display:flex; flex-direction:column; align-items:center;
  width:100%; padding:0 32px; box-sizing:border-box;
  position:relative; z-index:2;
}

/* ── Диск ── */
.ld-disc {
  position:relative; width:168px; height:168px;
  margin-bottom:34px;
  animation:ldPop .7s cubic-bezier(.2,.9,.25,1.15) both;
}
@keyframes ldPop {
  from { opacity:0; transform:scale(.82); }
  to   { opacity:1; transform:scale(1); }
}
.ld-disc-halo {
  position:absolute; inset:-34px; border-radius:50%;
  background:radial-gradient(circle, rgba(91,184,255,.26) 0%, rgba(169,139,255,.14) 42%, transparent 68%);
  animation:ldHalo 3.2s ease-in-out infinite;
}
@keyframes ldHalo { 0%,100% { opacity:.65; transform:scale(.96); } 50% { opacity:1; transform:scale(1.04); } }

/* Внешнее голо-кольцо (вращается) */
.ld-disc-ring {
  position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(from 0deg, #5FF5DF, #5BB8FF 28%, #A98BFF 56%, #F58BF0 78%, #5FF5DF);
  -webkit-mask:radial-gradient(circle closest-side, transparent 89%, #000 91%, #000 98.5%, transparent 100%);
          mask:radial-gradient(circle closest-side, transparent 89%, #000 91%, #000 98.5%, transparent 100%);
  animation:ldSpin 3.6s linear infinite;
}
@keyframes ldSpin { to { transform:rotate(360deg); } }

/* Сам диск: тёмное стекло с концентрическими дорожками */
.ld-disc-face {
  position:absolute; inset:14px; border-radius:50%; overflow:hidden;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.055) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 34% 26%, rgba(111,233,255,.30) 0%, transparent 46%),
    radial-gradient(circle at 70% 78%, rgba(245,139,240,.22) 0%, transparent 50%),
    radial-gradient(circle, #1a1640 0%, #0d0b20 62%, #080713 100%);
  box-shadow:
    inset 0 0 0 1px rgba(160,190,255,.22),
    inset 0 0 26px rgba(91,184,255,.18),
    0 14px 38px rgba(0,0,0,.55);
}
/* Блик, медленно бегущий по диску */
.ld-disc-sheen {
  position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(from 0deg,
    transparent 0deg, rgba(255,255,255,.20) 28deg, transparent 62deg,
    transparent 180deg, rgba(169,139,255,.22) 208deg, transparent 242deg, transparent 360deg);
  animation:ldSpin 5.4s linear infinite reverse;
}
/* Центр с процентом */
.ld-disc-hub {
  position:absolute; inset:27%; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 50% 35%, #15122c, #08070f);
  box-shadow:inset 0 0 0 1px rgba(160,190,255,.28), 0 0 18px rgba(91,184,255,.28);
}
.ld-bar-pct {
  font-family:var(--ld-font-display); font-weight:800; font-size:15px;
  letter-spacing:.02em; color:var(--ld-bright);
  font-variant-numeric:tabular-nums;
  text-shadow:0 0 14px rgba(111,233,255,.55);
}

/* ── Полоса-слайдер ── */
.ld-bar-wrap {
  width:100%; max-width:236px; margin-bottom:30px;
  animation:ldFadeIn .7s .15s both;
}
.ld-bar {
  --ld-p:0;
  position:relative; width:100%; height:6px; border-radius:99px;
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 0 0 1px rgba(160,190,255,.10);
}
.ld-bar-fill {
  position:absolute; inset:0; border-radius:99px;
  background:linear-gradient(90deg,#5FF5DF,#5BB8FF 45%,#A98BFF 75%,#F58BF0);
  box-shadow:0 0 12px rgba(91,184,255,.55);
  /* clip-path вместо width — не трогаем layout и сохраняем скругление */
  clip-path:inset(0 calc(100% - var(--ld-p) * 100%) 0 0 round 99px);
}
.ld-bar-knob {
  position:absolute; top:50%; left:calc(var(--ld-p) * 100%);
  width:16px; height:16px; margin:-8px 0 0 -8px; border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 3px rgba(111,233,255,.30), 0 0 16px rgba(111,233,255,.85);
}

/* ── Вордмарк ── */
.ld-title {
  display:flex; align-items:baseline; gap:10px; margin-bottom:10px;
  animation:ldFadeIn .7s .25s both;
}
.ld-word-lucky, .ld-word-drop {
  font-family:var(--ld-font-display); font-weight:900; font-style:italic;
  font-size:30px; letter-spacing:.02em; line-height:1;
}
.ld-word-lucky { color:#fff; }
.ld-word-drop {
  background:var(--ld-holo);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
  padding-right:4px; /* курсив не обрезается по background-clip */
}
.ld-sub {
  font-family:var(--ld-font-ui); font-size:10px; letter-spacing:.32em;
  color:rgba(200,206,230,.5); text-transform:uppercase; font-weight:700;
  text-align:center;
  animation:ldFadeIn .7s .35s both;
}
@keyframes ldFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

@media (prefers-reduced-motion: reduce) {
  .ld-disc, .ld-disc-halo, .ld-disc-ring, .ld-disc-sheen,
  .ld-bar-wrap, .ld-title, .ld-sub { animation:none; }
}

.nav-item{
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:9px 0 8px; cursor:pointer; gap:2px;
  border-radius:18px;
  transition:all .25s cubic-bezier(.4,.0,.2,1);
  position:relative;
}
.nav-icon{
  font-size:21px; line-height:1;
  transition:transform .25s;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.5));
}
.nav-item.active .nav-icon{ transform:translateY(-1px) scale(1.08); }
.nav-label{
  font-size:9px; font-weight:700; letter-spacing:.8px; text-transform:uppercase;
  color:var(--muted); transition:color .25s;
}
.nav-item.active .nav-label{ color:var(--ld-ice); }

.screens{ flex:1; overflow:hidden; position:relative; }
.screen{
  position:absolute; inset:0;
  overflow-y:auto; overflow-x:hidden;
  display:none; -webkit-overflow-scrolling:touch;
  padding-bottom:120px;
  animation:screenIn .4s cubic-bezier(.2,.0,.2,1);
}
.screen.active{ display:block; }
/* Анимация смены вкладок управляется из ui.js (директional slide) */

.nav-wrap{
  position:fixed; bottom:14px; left:14px; right:14px; z-index:60;
  padding-bottom:env(safe-area-inset-bottom);
  pointer-events:none;
}
.nav{
  pointer-events:all;
  display:flex;
  align-items:flex-end;
  position:relative;
  background:rgba(14,12,26,.6);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border:1px solid rgba(255,255,255,.10);
  border-radius:22px;
  padding:5px 6px 7px;
  box-shadow:
    0 14px 40px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 0 0 1px rgba(255,255,255,.02);
}
.nav-item{ -webkit-tap-highlight-color: transparent; }
.nav-item:active{ transform: scale(.93); }
.nav-wrap::after{
  content:'';
  position:fixed;
  bottom:0; left:0; right:0; height:14px;
  background:var(--bg);
  z-index:59;
}



.nav-item { z-index: 1; }

/* ══ Лидерборд — кнопка "как считается" ═══════════════════════════════ */
.leaders-howto-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 12px; padding: 10px 16px;
  background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.25);
  border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 600;
  letter-spacing: .3px; cursor: pointer; transition: all .18s;
}
.leaders-howto-btn:active { background: rgba(139,92,246,.22); color: var(--ld-ice); }

/* ══ Лидерборд — попап рейтинга ════════════════════════════════════════ */
.leaders-popup-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.leaders-popup-overlay.show { opacity: 1; pointer-events: all; }
.leaders-popup {
  width: 100%; max-width: 360px; max-height: 80vh; overflow-y: auto;
  background: #161030; border: 1px solid rgba(139,92,246,.4);
  border-radius: 22px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(139,92,246,.15);
  transform: scale(.93) translateY(16px);
  transition: transform .25s cubic-bezier(.2,0,.2,1);
}
.leaders-popup-overlay.show .leaders-popup { transform: scale(1) translateY(0); }
.leaders-popup::-webkit-scrollbar { width: 4px; }
.leaders-popup::-webkit-scrollbar-track { background: rgba(169,139,255,.08); border-radius: 4px; }
.leaders-popup::-webkit-scrollbar-thumb { background: rgba(169,139,255,.45); border-radius: 4px; }
.leaders-popup::-webkit-scrollbar-thumb:hover { background: rgba(169,139,255,.7); }
.leaders-popup { scrollbar-width: thin; scrollbar-color: rgba(169,139,255,.45) rgba(169,139,255,.08); }
.leaders-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.leaders-popup-title {
  font-family: 'Bebas Neue'; font-size: 18px; letter-spacing: 1.5px; color: var(--text);
}
.leaders-popup-close {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.07); border: none;
  color: var(--muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.leaders-popup-close:active { background: rgba(255,255,255,.14); }
.leaders-popup-body { padding: 16px 18px 20px; }
.ld-info-section { margin-bottom: 14px; }
.ld-info-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ld-info-text { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.ld-info-divider { height: 1px; background: rgba(255,255,255,.07); margin: 14px 0; }
.ld-info-prizes { font-size: 12px; color: var(--text-dim); line-height: 2; margin-bottom: 14px; }
.ld-info-note {
  font-size: 11px; color: var(--muted); line-height: 1.6;
  padding: 10px 12px; background: rgba(255,255,255,.04);
  border-radius: 10px; border: 1px solid rgba(255,255,255,.06);
}

/* ══ Лидерборд — сезонная плашка ══════════════════════════════════════ */
.leaders-banner {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1e1040 0%, #2a1060 50%, #1a0e35 100%);
  border: 1px solid rgba(111,233,255,.22);
  box-shadow: 0 4px 24px rgba(91,184,255,.14);
}
.leaders-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(169,139,255,.22) 0%, transparent 65%);
  pointer-events: none;
}
.leaders-banner-body {
  display: flex; flex-direction: column; gap: 5px; z-index: 1;
}
.leaders-banner-season {
  font-family: var(--ld-font-display, 'Unbounded'), sans-serif;
  font-weight: 800; font-size: 20px; letter-spacing: .5px;
  line-height: 1.15;
  background: var(--ld-holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(91,184,255,.35));
}
.leaders-banner-desc {
  font-family: 'Manrope', sans-serif; font-weight: 500;
  font-size: 12.5px; color: rgba(255,255,255,.6); line-height: 1.35;
}
.leaders-banner-ends-label {
  font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: 10.5px; color: var(--ld-ice); margin-top: 6px;
  text-transform: uppercase; letter-spacing: 1.2px;
}
.leaders-banner-timer {
  display: flex; flex-direction: column; gap: 3px;
}
.leaders-banner-timer .ld-timer-days {
  display: flex; align-items: baseline; gap: 6px;
}
.leaders-banner-timer .ld-timer-days-num {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 27px; line-height: 1; letter-spacing: .5px;
  color: var(--ld-ice); text-shadow: 0 0 18px rgba(111,233,255,.65);
}
.leaders-banner-timer .ld-timer-days-unit {
  font-family: 'Manrope', sans-serif; font-weight: 600;
  font-size: 13px; color: rgba(255,255,255,.5);
}
.leaders-banner-timer .ld-timer-clock {
  font-family: 'Space Mono', monospace; font-weight: 700;
  font-size: 20px; letter-spacing: .5px;
  color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.25);
}
.leaders-banner-timer .ld-timer-clock .ld-timer-colon {
  color: rgba(255,255,255,.4); margin: 0 1px;
}
@keyframes glitchon-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.leaders-banner-glitchon {
  width: 100px; height: 100px; object-fit: contain;
  flex-shrink: 0; z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(139,92,246,.45));
  animation: glitchon-float 3s ease-in-out infinite;
}

/* ══ Лидерборд ════════════════════════════════════════════════════════ */
.leaders-tabs {
  position: relative;
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 3px;
  gap: 0;
}
.leaders-tab-slider {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(25% - 2px);
  background: rgba(91,184,255,.18);
  border: 1px solid rgba(91,184,255,.4);
  border-radius: 9px;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.leaders-tab {
  flex: 1; padding: 9px 0;
  background: transparent; border: none;
  border-radius: 9px; color: var(--muted);
  font-family: 'Bebas Neue'; font-size: 13px; letter-spacing: 1.5px;
  cursor: pointer; transition: color .2s;
  position: relative; z-index: 1;
}
.leaders-tab.active {
  color: var(--ld-ice);
}
.leaders-season-switch {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.leaders-season-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; color: var(--muted);
  font-family: 'Bebas Neue'; font-size: 12px; letter-spacing: 1px;
  cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.leaders-season-btn.active {
  color: var(--ld-ice);
  background: rgba(91,184,255,.18); border-color: rgba(91,184,255,.4);
}
.leaders-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  margin-bottom: 10px; transition: background .15s;
}
.leaders-row.is-me {
  background: rgba(91,184,255,.09); border-color: rgba(91,184,255,.28);
}
@keyframes medal-float {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 4px currentColor); }
  50%       { transform: translateY(-4px) scale(1.12); filter: drop-shadow(0 0 10px currentColor); }
}
.leaders-rank {
  font-family: 'Bebas Neue'; font-size: 20px; color: var(--muted);
  width: 28px; text-align: center; flex-shrink: 0; letter-spacing: .5px;
}
.leaders-rank.gold   { color: #FFD700; font-size: 24px; animation: medal-float 2s ease-in-out infinite; }
.leaders-rank.silver { color: #C0C0C0; font-size: 24px; animation: medal-float 2.3s ease-in-out infinite; }
.leaders-rank.bronze { color: #CD7F32; font-size: 24px; animation: medal-float 2.6s ease-in-out infinite; }
.leaders-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
}
.leaders-avatar-img {
  object-fit: cover; display: block;
}
.leaders-name-block {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.leaders-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leaders-prize {
  width: 40px; height: 40px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(139,92,246,.35));
}
.leaders-score-val {
  font-size: 13px; font-weight: 800; color: #FFD75A;
  font-family: 'Bebas Neue'; letter-spacing: .5px;
}

/* ══ SVG иконки вкладок ════════════════════════════════════════════ */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.nav-svg {
  width: 24px;
  height: 24px;
  color: var(--muted);
  transition: color .25s, transform .25s, filter .25s;
  display: block;
}
.nav-item.active .nav-svg {
  color: var(--ld-ice);
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 0 8px rgba(111,233,255,.85)) drop-shadow(0 0 16px rgba(111,233,255,.35));
}
