/* Контейнер зала славы */
.top-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Карточка ранга */
.rank-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: opacity, transform, max-height, padding;
    flex-shrink: 0;
    max-height: 60px;
    overflow: hidden;
}

.rank-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rank-card.mine {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #6366f1) 8%, transparent) 0%, color-mix(in srgb, var(--accent, #6366f1) 3%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 12px color-mix(in srgb, var(--accent, #6366f1) 15%, transparent);
}

.rank-card.mine:hover {
    border-color: color-mix(in srgb, var(--accent, #6366f1) 60%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px color-mix(in srgb, var(--accent, #6366f1) 30%, transparent);
}

.rank-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #71717a;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.25s ease, color 0.25s ease;
}

.rank-card.mine .rank-number {
    background: transparent;
    color: var(--accent-light, #818cf8);
    border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 55%, transparent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 25%, transparent);
    text-shadow: 0 0 6px color-mix(in srgb, var(--accent, #6366f1) 50%, transparent);
}

.rank-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.rank-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #52525b;
    font-weight: 600;
}

/* =========================================
   СТИЛИ КАК У МЕНЮ
   ========================================= */
.apple-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.apple-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.matches-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

.match-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    animation: matchSlideIn 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    opacity: 0;
}

.match-stage-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.18);
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    margin-bottom: 8px;
}

.match-score-row-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.match-score-row-centered .match-player-name {
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.match-score-row-centered .match-player-name.winner {
    color: #fbbf24;
    font-weight: 600;
}

.match-score-badge {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

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

/* =========================================
   ЗАЛ СЛАВЫ: ФИКС + КАРТОЧКА МЕНЯ СНИЗУ
   ========================================= */

.top-list-wrapper {
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    padding-bottom: 10px;
    transition: all 0.3s ease;
}

.top-list-wrapper:has(.expanded) {
    -webkit-mask-image: none;
    mask-image: none;
    padding-bottom: 0;
}

.top-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    overscroll-behavior-y: contain;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Увеличили, чтобы 5-я карточка не обрезалась */
    max-height: 275px;
}

.top-list-container.expanded {
    max-height: 420px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hidden-item {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.show-item {
    animation: slideDown 0.3s ease forwards;
}

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

.top-list-container.expanded::-webkit-scrollbar {
    width: 4px;
}
.top-list-container.expanded::-webkit-scrollbar-track {
    background: transparent;
}
.top-list-container.expanded::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Кнопка снизу */
.top-toggle-btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.top-toggle-btn-full:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.top-toggle-btn-full:active {
    transform: scale(0.98);
}

/* Блок "Твоя позиция" под кнопкой */
.my-position-block {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.my-position-label {
    font-size: 11px;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-left: 4px;
    margin-bottom: 2px;
}
/* =========================================
   ДОРАБОТКА БЛОКА "ТВОЯ ПОЗИЦИЯ"
   ========================================= */

.my-position-block {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Плавное появление */
    animation: fadeInUp 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.my-position-label {
    font-size: 11px;
    color: #a1a1aa; /* Чуть светлее, чем было */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-left: 6px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Делаем карточку "моя позиция" более акцентной */
.my-position-block .rank-card.mine {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-left: 3px solid var(--accent, #6366f1); /* Вертикальная полоска */
    border-color: rgba(99, 102, 241, 0.2);
}

.my-position-block .rank-card.mine .rank-number {
    font-size: 13px; /* Чуть крупнее цифра */
    font-weight: 700;
}