/* Переключатель лиг - iOS стиль */
.league-switcher {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 2px;
    gap: 0;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.league-switcher::-webkit-scrollbar { display: none; }

/* Слайдер — стеклянный, с градиентом, бликом и glow */
.league-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(100% / 6 - 2px);
    height: calc(100% - 4px);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent, #6366f1) 22%, transparent) 0%,
        color-mix(in srgb, var(--accent, #6366f1) 14%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 2px 8px color-mix(in srgb, var(--accent, #6366f1) 25%, transparent),
        0 4px 16px color-mix(in srgb, var(--accent, #6366f1) 15%, transparent);
    transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 0;
    box-sizing: border-box;
}

.league-slider.pos-0 { transform: translateX(0); }
.league-slider.pos-1 { transform: translateX(calc(100% + 2px)); }
.league-slider.pos-2 { transform: translateX(calc(200% + 4px)); }
.league-slider.pos-3 { transform: translateX(calc(300% + 6px)); }
.league-slider.pos-4 { transform: translateX(calc(400% + 8px)); }
.league-slider.pos-5 { transform: translateX(calc(500% + 10px)); }

.league-pill {
    position: relative;
    z-index: 1;
    flex: 1 0 0;
    min-width: 0;
    text-align: center;
    padding: 8px 2px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #71717a;
    cursor: pointer;
    transition: color 0.35s ease, text-shadow 0.35s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.league-pill:hover { color: #e5e5e5; }

/* Активная лига — белый текст + лёгкий glow, без обводки (обводка от слайдера) */
.league-pill.active {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 60%, transparent);
}

/* Своя лига — обводка цветом темы */
.league-pill.my {
    color: var(--accent-light, #818cf8);
    border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 55%, transparent);
    font-weight: 600;
}

.league-pill.my.active {
    color: #ffffff;
    border-color: color-mix(in srgb, var(--accent, #6366f1) 55%, transparent);
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 60%, transparent);
}

.league-switcher {
    min-height: 38px;
}

.league-slider {
    height: auto;
    top: 2px;
    bottom: 2px;
}
/* Стили для выпадающей панели (вставляется как отдельный блок под карточкой) */
.rank-details-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    margin-top: -12px; /* Прижимаем к карточке */
    margin-bottom: 6px;
    padding-top: 12px;
    animation: slideDown 0.3s ease-out;
}

/* Активная карточка (чтобы нижние углы стали прямыми при раскрытии) */
.rank-card.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    margin-bottom: 0;
}

.rank-details-wrapper .rd-grid {
    padding: 0 14px 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.rd-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rd-item.rd-full {
    grid-column: span 3;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4px;
}

.rd-label {
    font-size: 10px;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.rd-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
