/* Leaderboard moderne — dark sci-fi YSkill */

.lb-modern {
  --lb-cyan: #00e8d4;
  --lb-violet: #b48cff;
  --lb-violet-dim: rgba(180, 140, 255, 0.22);
  --lb-gold: #ffd56a;
  --lb-silver: #c8d8f0;
  --lb-bronze: #d4a574;
  --lb-surface: rgba(8, 12, 22, 0.82);
  --lb-surface-2: rgba(14, 18, 32, 0.9);
  --lb-border: rgba(0, 232, 212, 0.18);
  --lb-glow-cyan: 0 0 18px rgba(0, 232, 212, 0.22);
  --lb-glow-violet: 0 0 20px rgba(180, 140, 255, 0.28);
}

.lb-modern .lb-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(180, 140, 255, 0.12);
  margin-bottom: 4px;
}

.lb-modern .lb-back-btn {
  flex-shrink: 0;
  border: 1px solid rgba(0, 232, 212, 0.35);
  background: linear-gradient(165deg, rgba(6, 28, 36, 0.95), rgba(4, 14, 22, 0.9));
  color: var(--lb-cyan);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lb-modern .lb-back-btn:hover,
.lb-modern .lb-back-btn:focus-visible {
  border-color: rgba(0, 232, 212, 0.75);
  box-shadow: var(--lb-glow-cyan);
  outline: none;
}

.lb-modern .lb-header-text {
  flex: 1;
  min-width: 0;
}

.lb-modern .lb-header .section-info-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.lb-modern .lb-header-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f0f4ff;
  line-height: 1.2;
}

.lb-modern .lb-header-subtitle {
  margin: 4px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(180, 200, 230, 0.78);
}

.lb-modern .lb-scroll {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 12px;
}

.lb-modern .lb-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 10px 0 8px;
  padding: 2px 2px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.lb-modern .lb-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(180, 140, 255, 0.28);
  background: var(--lb-surface);
  color: rgba(200, 210, 240, 0.88);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  white-space: nowrap;
}

.lb-modern .lb-tab-icon {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
}

.lb-modern .lb-tab.is-active {
  border-color: rgba(180, 140, 255, 0.85);
  background: linear-gradient(145deg, rgba(48, 28, 88, 0.95), rgba(20, 32, 64, 0.92));
  color: #fff;
  box-shadow: var(--lb-glow-violet);
}

.lb-modern .lb-hero-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 10px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.lb-modern .lb-hero-bar::-webkit-scrollbar {
  display: none;
}

.lb-modern .lb-hero-bar[hidden] {
  display: none !important;
}

.lb-modern .lb-hero-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 232, 212, 0.22);
  background: var(--lb-surface);
  color: #b8e8e0;
  border-radius: 12px;
  padding: 6px 12px 6px 6px;
  min-height: 44px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.lb-modern .lb-hero-tab-label {
  white-space: nowrap;
  line-height: 1.2;
}

.lb-modern .lb-hero-tab-portrait {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(0, 0, 0, 0.35);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  display: block;
  overflow: hidden;
}

.lb-modern .lb-hero-tab-portrait--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  background-image: none !important;
}

/* Legacy img hook — keep contain if any stale markup remains */
.lb-modern .lb-hero-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  object-position: center bottom;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px;
  box-sizing: border-box;
}

.lb-modern .lb-hero-tab.is-active {
  border-color: rgba(0, 232, 212, 0.7);
  background: linear-gradient(145deg, rgba(8, 40, 48, 0.95), rgba(12, 20, 36, 0.9));
  color: #e8fff8;
  box-shadow: var(--lb-glow-cyan);
}

.lb-modern .lb-hero-tab.is-locked {
  filter: blur(3px);
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.lb-modern .lb-hero-tab-soon {
  margin-left: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2a1800;
  background: linear-gradient(180deg, #ffe566, #ffb830);
  border: 1px solid rgba(255, 240, 180, 0.85);
  filter: none;
  opacity: 1;
}

.lb-modern .lb-hero-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 232, 212, 0.25);
  background: linear-gradient(135deg, rgba(6, 32, 42, 0.88), rgba(10, 14, 28, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lb-modern .lb-hero-banner-portrait {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  object-position: center bottom;
  border: 1px solid rgba(0, 232, 212, 0.35);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px;
  box-sizing: border-box;
}

.lb-modern .lb-hero-banner-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f2f8ff;
  line-height: 1.2;
}

.lb-modern .lb-hero-banner-tag {
  font-size: 0.68rem;
  color: var(--lb-cyan);
  margin-top: 2px;
}

.lb-modern .lb-hero-banner-stage {
  font-size: 0.68rem;
  color: rgba(200, 210, 230, 0.75);
  margin-top: 4px;
}

.lb-modern .lb-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.74rem;
  color: rgba(160, 200, 255, 0.9);
  min-height: 1.2em;
}

.lb-modern .lb-status.is-hint {
  color: #c8b8ff;
  background: rgba(120, 90, 200, 0.12);
  border: 1px solid rgba(179, 136, 255, 0.25);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.5rem;
}

.lb-modern .lb-status.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 232, 212, 0.25);
  border-top-color: var(--lb-cyan);
  border-radius: 50%;
  animation: lb-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lb-modern .lb-entries {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: lb-fade-in 0.22s ease;
}

@keyframes lb-fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lb-modern .lb-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--lb-surface-2);
  border: 1px solid var(--lb-border);
  font-size: 0.74rem;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.lb-modern .lb-card:active {
  transform: scale(0.99);
}

.lb-modern .lb-card--std:hover,
.lb-modern .lb-card--std:focus-within {
  border-color: rgba(180, 140, 255, 0.35);
}

.lb-modern .lb-card.is-selected {
  border-color: rgba(180, 140, 255, 0.65);
  box-shadow: var(--lb-glow-violet);
}

.lb-modern .lb-card--top1 {
  padding: 14px 14px;
  border-color: rgba(255, 213, 106, 0.55);
  background: linear-gradient(135deg, rgba(48, 36, 12, 0.92), rgba(18, 14, 8, 0.95));
  box-shadow: 0 0 24px rgba(255, 213, 106, 0.15);
}

.lb-modern .lb-card--top2 {
  border-color: rgba(200, 216, 240, 0.45);
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.92), rgba(10, 14, 24, 0.95));
  box-shadow: 0 0 18px rgba(200, 216, 240, 0.1);
}

.lb-modern .lb-card--top3 {
  border-color: rgba(212, 165, 116, 0.45);
  background: linear-gradient(135deg, rgba(36, 24, 14, 0.92), rgba(14, 10, 8, 0.95));
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.1);
}

.lb-modern .lb-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lb-modern .lb-card-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--lb-violet);
  line-height: 1.1;
}

.lb-modern .lb-card--top1 .lb-card-rank { color: var(--lb-gold); }
.lb-modern .lb-card--top2 .lb-card-rank { color: var(--lb-silver); }
.lb-modern .lb-card--top3 .lb-card-rank { color: var(--lb-bronze); }

.lb-modern .lb-card-medal {
  font-size: 0.85rem;
  line-height: 1;
}

.lb-modern .lb-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.lb-modern .lb-card--top1 .lb-card-avatar {
  width: 42px;
  height: 42px;
}

.lb-modern .lb-card-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.06);
}

.lb-modern .lb-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-modern .lb-card-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  font-weight: 700;
  color: #eef2ff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.lb-modern .lb-card-name-btn:hover,
.lb-modern .lb-card-name-btn:focus-visible {
  color: #fff;
  outline: none;
  text-decoration: underline dotted rgba(255, 255, 255, 0.35);
  text-underline-offset: 2px;
}

.lb-modern .lb-card-meta {
  font-size: 0.65rem;
  color: rgba(180, 195, 220, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-modern .lb-card-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
}

.lb-modern .lb-card-score-primary {
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffe8a8;
  line-height: 1.1;
  white-space: nowrap;
}

.lb-modern .lb-card--top1 .lb-card-score-primary {
  font-size: 1.05rem;
  color: var(--lb-gold);
}

.lb-modern .lb-card-score-secondary {
  font-size: 0.62rem;
  color: rgba(200, 210, 230, 0.65);
  font-variant-numeric: tabular-nums;
}

.lb-modern .lb-card-score-icon {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-left: 4px;
}

.lb-modern .lb-card-badge-verified {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lb-cyan);
  border: 1px solid rgba(0, 232, 212, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 2px;
}

.lb-modern .lb-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: rgba(200, 210, 230, 0.6);
  font-size: 0.78rem;
  border-radius: 14px;
  border: 1px dashed rgba(180, 140, 255, 0.2);
  background: rgba(8, 12, 20, 0.5);
}

.lb-modern .lb-my-rank-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 232, 212, 0.4);
  background: linear-gradient(145deg, rgba(12, 36, 52, 0.92), rgba(20, 16, 48, 0.88));
  box-shadow: var(--lb-glow-cyan);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.lb-modern .lb-my-rank-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lb-cyan);
  margin-bottom: 8px;
}

.lb-modern .lb-my-rank-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.lb-modern .lb-my-rank-rank {
  font-size: 1rem;
  font-weight: 800;
  color: var(--lb-violet);
  font-variant-numeric: tabular-nums;
}

.lb-modern .lb-my-rank-info {
  min-width: 0;
}

.lb-modern .lb-my-rank-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0f4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-modern .lb-my-rank-detail {
  font-size: 0.68rem;
  color: rgba(200, 210, 230, 0.75);
  margin-top: 2px;
}

.lb-modern .lb-my-rank-score {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffe8a8;
  text-align: right;
  white-space: nowrap;
}

.lb-modern .lb-my-rank-card.is-muted {
  border-color: rgba(180, 140, 255, 0.25);
  box-shadow: none;
  background: rgba(12, 8, 22, 0.75);
}

.lb-modern .lb-my-rank-card.is-muted .lb-my-rank-label {
  color: rgba(180, 140, 255, 0.75);
}

.lb-modern .lb-player-card-inline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lb-modern .lb-player-card {
  margin-top: 0;
  border: 1px solid rgba(180, 140, 255, 0.35);
  border-radius: 14px;
  background: rgba(10, 14, 26, 0.95);
  padding: 10px 12px;
}

.lb-modern .lb-section-head {
  display: none;
}

.lb-modern .lb-board-hint {
  display: none;
}

#lbMenu.lb-modern.ys-progress-menu {
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top, 0px)) 12px max(10px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(6, 8, 18, 0.98), rgba(3, 5, 10, 0.99));
}

#lbMenu.lb-modern .lb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#lbMenu.lb-modern .lb-content-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.lb-modern .lb-event-strip {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 216, 116, 0.28);
  background: linear-gradient(135deg, rgba(36, 24, 8, 0.75), rgba(12, 10, 20, 0.9));
}

.lb-modern .lb-event-strip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.lb-modern .lb-event-strip-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd56a;
}

.lb-modern .lb-event-strip-countdown {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffe8a8;
}

.lb-modern .lb-event-strip-prize {
  margin: 0 0 4px;
  font-size: 0.66rem;
  color: rgba(255, 232, 168, 0.88);
  line-height: 1.35;
}

.lb-modern .lb-event-strip-rule {
  margin: 0;
  font-size: 0.64rem;
  color: rgba(200, 210, 230, 0.72);
  line-height: 1.35;
}

.lb-modern .lb-event-strip-info {
  margin-top: 8px;
  border: 1px solid rgba(255, 216, 116, 0.35);
  background: rgba(255, 216, 116, 0.08);
  color: #ffe8a8;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.lb-modern .lb-state-card {
  list-style: none;
  margin: 0 0 10px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 140, 255, 0.22);
  background: rgba(10, 14, 26, 0.88);
  text-align: center;
}

.lb-modern .lb-state-card--error {
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(145deg, rgba(40, 12, 18, 0.85), rgba(12, 10, 22, 0.92));
}

.lb-modern .lb-state-card--empty {
  border-style: dashed;
}

.lb-modern .lb-state-title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
}

.lb-modern .lb-state-text {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(200, 210, 230, 0.82);
}

.lb-modern .lb-state-sub {
  margin: 8px 0 0;
  font-size: 0.66rem;
  color: #64748b;
  line-height: 1.4;
}

.lb-modern .lb-state-retry {
  margin-top: 12px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0, 232, 212, 0.45);
  background: linear-gradient(180deg, rgba(8, 40, 48, 0.95), rgba(6, 20, 32, 0.9));
  color: #00e8d4;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.lb-modern .lb-skeleton-card {
  list-style: none;
  display: grid;
  grid-template-columns: 2.4rem 2.4rem 1fr 3.5rem;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(12, 16, 28, 0.65);
  overflow: hidden;
  position: relative;
}

.lb-modern .lb-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 45%,
    transparent 90%
  );
  animation: lb-shimmer 1.4s ease-in-out infinite;
}

@keyframes lb-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.lb-modern .lb-skeleton-rank,
.lb-modern .lb-skeleton-avatar,
.lb-modern .lb-skeleton-line,
.lb-modern .lb-skeleton-score {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.lb-modern .lb-skeleton-rank {
  height: 22px;
}

.lb-modern .lb-skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.lb-modern .lb-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-modern .lb-skeleton-line {
  height: 10px;
  width: 72%;
}

.lb-modern .lb-skeleton-line--wide {
  width: 92%;
  height: 12px;
}

.lb-modern .lb-skeleton-score {
  height: 18px;
  width: 100%;
}

.lb-modern .lb-my-rank-guest {
  margin: 0;
  font-size: 0.74rem;
  color: rgba(200, 210, 230, 0.78);
  line-height: 1.4;
}

.lb-modern .lb-card {
  list-style: none;
}

@media (max-width: 380px) {
  .lb-modern .lb-card-score-primary {
    font-size: 0.82rem;
  }
  .lb-modern .lb-card--top1 .lb-card-score-primary {
    font-size: 0.92rem;
  }
  .lb-modern .lb-tab {
    padding: 7px 10px;
    font-size: 0.66rem;
  }
}
