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

/* ── Lucky Drop Loader ── */
#loader {
  position:fixed; inset:0; z-index:1000;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(ellipse 55% 35% at 50% 0%, rgba(120,60,255,.22) 0%, transparent 65%),
    radial-gradient(130% 90% at 50% 0%, #1a1035 0%, #0c0a1a 45%, #06060f 100%);
  transition:opacity .8s cubic-bezier(.4,0,.2,1), visibility .8s;
  overflow:hidden;
}
#loader.hidden { opacity:0; visibility:hidden; pointer-events:none; }

#loader-canvas {
  position:absolute; inset:0; width:100%; height:100%;
  opacity:.55;
}

.ld-particles { position:absolute; inset:0; pointer-events:none; }
.ld-particle {
  position:absolute; border-radius:50%; pointer-events:none;
  animation:ldPartFloat linear infinite;
}
@keyframes ldPartFloat {
  0%   { transform:translateY(100vh) scale(0); opacity:0; }
  10%  { opacity:1; }
  90%  { opacity:1; }
  100% { transform:translateY(-20px) scale(1); opacity:0; }
}

.ld-content {
  display:flex; flex-direction:column; align-items:center;
  gap:0; z-index:2; position:relative;
}

/* ── Central icon ── */
.ld-icon {
  position:relative; width:152px; height:152px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:28px;
}

/* Outer faint orbit */
.ld-ring-outer {
  position:absolute; top:50%; left:50%;
  width:152px; height:152px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  border:1px solid rgba(91,184,255,.1);
  animation:ldRingSpin 14s linear infinite reverse;
}

/* Middle dashed ring */
.ld-ring-dots {
  position:absolute; top:50%; left:50%;
  width:130px; height:130px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  border:1px dashed rgba(169,139,245,.22);
  animation:ldRingSpin 8s linear infinite;
}

/* Main holo conic-gradient ring */
.ld-ring-holo {
  position:absolute; top:50%; left:50%;
  width:112px; height:112px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:conic-gradient(from 0deg, #5FF5DF, #5BB8FF 30%, #A98BFF 60%, #F58BF0 80%, #5FF5DF);
  animation:ldRingSpin 3s linear infinite;
  filter:drop-shadow(0 0 8px rgba(91,184,255,.5));
}
.ld-ring-holo::after {
  content:''; position:absolute; inset:2px;
  border-radius:50%; background:#06060f;
}

@keyframes ldRingSpin { to { transform:translate(-50%,-50%) rotate(360deg); } }

/* Star/logo core */
.ld-star-wrap {
  position:relative; z-index:4;
  width:82px; height:82px; border-radius:50%;
  background:radial-gradient(circle at 38% 32%, #201c42 0%, #0e0c22 100%);
  display:flex; align-items:center; justify-content:center;
  box-shadow:
    0 0 0 1px rgba(91,184,255,.2),
    0 0 32px rgba(95,245,223,.14),
    0 0 80px rgba(91,184,255,.08),
    inset 0 1px 0 rgba(255,255,255,.07);
  animation:ldStarPulse 2.5s ease-in-out infinite;
}
@keyframes ldStarPulse {
  0%,100% {
    box-shadow:0 0 0 1px rgba(91,184,255,.2),0 0 32px rgba(95,245,223,.14),0 0 80px rgba(91,184,255,.08),inset 0 1px 0 rgba(255,255,255,.07);
  }
  50% {
    box-shadow:0 0 0 1px rgba(169,139,245,.45),0 0 55px rgba(95,245,223,.28),0 0 120px rgba(169,139,245,.15),inset 0 1px 0 rgba(255,255,255,.1);
  }
}

.ld-star-icon {
  font-size:36px; display:block; line-height:1;
  background:linear-gradient(120deg,#7BF7E4,#5BB8FF 45%,#A98BFF 75%,#F58BF0);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 0 14px rgba(91,184,255,.7));
  animation:ldIconSpin 5s ease-in-out infinite;
}
@keyframes ldIconSpin {
  0%,100% { transform:scale(1) rotate(0deg);     filter:drop-shadow(0 0 14px rgba(91,184,255,.7)); }
  33%      { transform:scale(1.1) rotate(120deg); filter:drop-shadow(0 0 22px rgba(169,139,245,.9)); }
  66%      { transform:scale(1.05) rotate(240deg); filter:drop-shadow(0 0 18px rgba(245,139,240,.8)); }
}

/* ── Title ── */
.ld-title {
  display:flex; align-items:baseline; gap:10px;
  margin-bottom:10px;
}
.ld-word-lucky {
  font-family:'Bebas Neue'; font-size:52px; letter-spacing:6px; line-height:1;
  color:#fff;
  animation:ldWordIn .8s cubic-bezier(.175,.885,.32,1.275) both;
}
.ld-word-drop {
  font-family:'Bebas Neue'; font-size:52px; letter-spacing:6px; line-height:1;
  background:linear-gradient(120deg,#7BF7E4,#5BB8FF 45%,#A98BFF 75%,#F58BF0);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  filter:drop-shadow(0 0 20px rgba(91,184,255,.5));
  animation:ldWordIn .8s .15s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes ldWordIn {
  0%   { opacity:0; transform:translateY(20px) scale(.9); }
  100% { opacity:1; transform:translateY(0) scale(1); }
}

.ld-sub {
  font-size:9px; letter-spacing:4px; color:rgba(255,255,255,.22);
  text-transform:uppercase; font-weight:600;
  margin-bottom:36px;
  animation:ldFadeIn 1s .4s both;
}
@keyframes ldFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* ── Progress bar ── */
.ld-bar-wrap {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  animation:ldFadeIn 1s .6s both;
}
.ld-bar {
  width:200px; height:3px;
  background:rgba(255,255,255,.06); border-radius:99px; overflow:hidden;
}
.ld-bar-fill {
  height:100%; width:0%; border-radius:99px;
  background:linear-gradient(90deg,#5FF5DF,#5BB8FF,#A98BFF,#F58BF0);
  transition:width .3s ease;
  box-shadow:0 0 12px rgba(91,184,255,.7), 0 0 4px rgba(95,245,223,.5);
}
.ld-bar-pct {
  font-size:10px; letter-spacing:2px; color:rgba(255,255,255,.25);
  font-family:'Bebas Neue';
}

.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: 20px;
  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: 30px; height: 30px; border-radius: 8px; 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));
}
