/* /top — сайдбар жанров + компактные карточки, mobile-first */
.top-page {
    --top-surface: rgba(26, 22, 37, 0.92);
    --top-border: rgba(55, 65, 81, 0.85);
    --top-muted: #9ca3af;
    --top-brand: #8b5cf6;
    --top-coral: #e16252;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.top-page__schema-tracks {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    list-style: none;
}

/* ——— Hero ——— */
.top-hero {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}
@media (min-width: 768px) {
    .top-hero {
        gap: 1rem;
        margin-bottom: 1.15rem;
    }
}
.top-hero__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, var(--hero-from) 0%, var(--hero-to) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 20px -12px var(--hero-glow);
}
@media (min-width: 768px) {
    .top-hero__icon {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 0.9rem;
    }
}
.top-hero__icon svg {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--hero-icon);
}
@media (min-width: 768px) {
    .top-hero__icon svg { width: 1.75rem; height: 1.75rem; }
}
.top-hero__text { min-width: 0; flex: 1; }
.top-hero__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .top-hero__title { font-size: 1.65rem; }
}
.top-hero__lead {
    margin: 0.25rem 0 0;
    max-width: 40rem;
    color: var(--top-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}
@media (min-width: 768px) {
    .top-hero__lead { font-size: 0.875rem; margin-top: 0.35rem; }
}
.top-hero__lead a { color: #c4b5fd; text-decoration: none; }
.top-hero__lead a:hover { color: #ede9fe; text-decoration: underline; }

/* ——— Info: горизонтальный скролл на мобилке ——— */
.top-info {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0 -0.15rem 0.9rem;
    padding: 0 0.15rem 0.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.top-info::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
    .top-info {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.65rem;
        margin: 0 0 1.15rem;
        padding: 0;
        overflow: visible;
    }
}
.top-info__card {
    flex: 0 0 auto;
    width: min(72vw, 14.5rem);
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    border: 1px solid var(--top-border);
    background: var(--top-surface);
}
@media (min-width: 768px) {
    .top-info__card {
        width: auto;
        padding: 0.7rem 0.85rem;
        border-radius: 0.75rem;
    }
}
.top-info__label {
    display: block;
    margin: 0 0 0.15rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--top-brand);
}
.top-info__card--vote .top-info__label { color: #6ee7b7; }
.top-info__card--reward .top-info__label { color: #fbbf24; }
.top-info__text {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.35;
    color: #d1d5db;
}
@media (min-width: 768px) {
    .top-info__text { font-size: 0.75rem; }
}
.top-info__text a { color: #c4b5fd; text-decoration: none; }
.top-info__text a:hover { text-decoration: underline; }

.top-page__notice {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    color: #fcd34d;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
}
@media (min-width: 768px) {
    .top-page__notice { font-size: 0.8125rem; margin-bottom: 1rem; }
}
.top-page__notice a { color: #fde68a; text-decoration: underline; }

/* ——— Layout: жанры + чарт ——— */
.top-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    width: 100%;
    min-width: 0;
}
@media (min-width: 900px) {
    .top-layout {
        grid-template-columns: 11.5rem minmax(0, 1fr);
        gap: 1.15rem;
    }
}
@media (min-width: 1100px) {
    .top-layout {
        grid-template-columns: 13rem minmax(0, 1fr);
        gap: 1.35rem;
    }
}

.top-genres {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 0.75rem;
    border: 1px solid var(--top-border);
    background: var(--top-surface);
    padding: 0.55rem 0 0.55rem 0.6rem;
    overflow: hidden;
}
@media (min-width: 900px) {
    .top-genres {
        position: sticky;
        top: 0.75rem;
        padding: 0.75rem 0.6rem;
        max-height: calc(100vh - 1.5rem);
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: 0.85rem;
    }
}
.top-genres__head {
    margin: 0 0 0.45rem;
    padding: 0 0.6rem 0 0.15rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
}
.top-genres__list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0.6rem 0.2rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}
.top-genres__list::-webkit-scrollbar {
    height: 3px;
}
.top-genres__list::-webkit-scrollbar-track {
    background: transparent;
}
.top-genres__list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 9999px;
}
@media (min-width: 900px) {
    .top-genres__list {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
        scrollbar-width: none;
    }
    .top-genres__list::-webkit-scrollbar { display: none; }
}
.top-genres__item {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: none;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #d1d5db;
    text-decoration: none;
    border: 1px solid rgba(75, 85, 99, 0.7);
    background: rgba(15, 12, 24, 0.45);
    white-space: nowrap;
    line-height: 1.25;
    scroll-snap-align: start;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.top-genres__item > meta,
.top-genres__item > link {
    display: none !important;
}
@media (min-width: 900px) {
    .top-genres__item {
        width: 100%;
        flex: none;
        font-size: 0.8125rem;
        padding: 0.4rem 0.65rem;
        white-space: normal;
        border-color: transparent;
        background: transparent;
        line-height: 1.3;
        scroll-snap-align: none;
    }
}
.top-genres__item:hover {
    color: #fff;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.25);
}
.top-genres__item.is-active {
    color: #fff;
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(167, 139, 250, 0.45);
}

.top-chart {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.top-chart__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.65rem;
}
.top-chart__title {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}
@media (min-width: 768px) {
    .top-chart__title { font-size: 0.8125rem; }
}
.top-chart__count {
    font-size: 0.7rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.top-page__loading,
.top-page__empty {
    text-align: center;
    color: var(--top-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--top-border);
    background: var(--top-surface);
}
.top-page__empty a { color: #c4b5fd; text-decoration: none; }
.top-page__empty a:hover { color: #ede9fe; text-decoration: underline; }

/* ——— Список: на мобилке колонка, с 640 — сетка ——— */
.top-page__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}
@media (min-width: 640px) {
    .top-page__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}
@media (min-width: 1100px) {
    .top-page__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

/* ——— Карточка: mobile = горизонтальная компактная ——— */
.top-track-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 0;
    height: auto;
    padding: 0;
    overflow: hidden;
    border-radius: 0.7rem;
    background: rgba(26, 22, 37, 0.95);
    border: 1px solid rgba(55, 65, 81, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
@media (min-width: 640px) {
    .top-track-card {
        flex-direction: column;
        height: 100%;
        border-radius: 0.8rem;
    }
    .top-track-card:hover {
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 8px 22px -16px rgba(124, 58, 237, 0.5);
    }
}
.top-track-card.is-highlight {
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}
.top-track-card.is-first { border-color: rgba(251, 191, 36, 0.5); }
.top-track-card.is-second { border-color: rgba(148, 163, 184, 0.45); }
.top-track-card.is-third { border-color: rgba(217, 119, 6, 0.45); }

.top-track-card__rank {
    position: absolute;
    left: 0.35rem;
    top: 0.35rem;
    z-index: 3;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.25rem;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #e16252 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
@media (min-width: 640px) {
    .top-track-card__rank {
        left: 0.5rem;
        top: 0.5rem;
        min-width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
    }
}
.top-track-card.is-first .top-track-card__rank {
    color: #78350f;
    background: linear-gradient(135deg, #f59e0b, #fde68a);
}
.top-track-card.is-second .top-track-card__rank {
    color: #1e293b;
    background: linear-gradient(135deg, #94a3b8, #f1f5f9);
}
.top-track-card.is-third .top-track-card__rank {
    color: #431407;
    background: linear-gradient(135deg, #c2410c, #fdba74);
}

.top-track-card__cover {
    position: relative;
    flex: 0 0 4.75rem;
    width: 4.75rem;
    align-self: stretch;
    min-height: 4.75rem;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(225, 98, 82, 0.14));
    border-right: 1px solid rgba(55, 65, 81, 0.7);
}
@media (min-width: 640px) {
    .top-track-card__cover {
        flex: none;
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 10;
        border-right: none;
        border-bottom: 1px solid rgba(55, 65, 81, 0.7);
    }
}
.top-track-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.top-track-card__cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    opacity: 0.85;
}
@media (min-width: 640px) {
    .top-track-card__cover-fallback { font-size: 2rem; }
}

.top-track-card__play-overlay {
    position: absolute;
    right: 0.3rem;
    bottom: 0.3rem;
    z-index: 2;
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #e16252 100%);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.4);
    cursor: pointer;
    touch-action: manipulation;
    transition: filter 0.15s ease, transform 0.15s ease;
}
@media (min-width: 640px) {
    .top-track-card__play-overlay {
        right: 0.55rem;
        bottom: 0.55rem;
        width: 2.35rem;
        height: 2.35rem;
    }
}
.top-track-card__play-overlay:hover { filter: brightness(1.08); }
.top-track-card__play-overlay:active { transform: scale(0.96); }
.top-track-card__play-overlay svg { width: 0.85rem; height: 0.85rem; }
@media (min-width: 640px) {
    .top-track-card__play-overlay svg { width: 1.05rem; height: 1.05rem; }
}

.top-track-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
    padding: 0.45rem 0.55rem 0.5rem;
    min-width: 0;
}
@media (min-width: 640px) {
    .top-track-card__body {
        gap: 0.4rem;
        padding: 0.65rem 0.7rem 0.7rem;
    }
}

.top-track-card__podium {
    display: none;
}
@media (min-width: 640px) {
    .top-track-card__podium {
        display: inline-flex;
        align-self: flex-start;
        margin: 0;
        font-size: 0.575rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        padding: 0.12rem 0.4rem;
        border-radius: 0.3rem;
    }
}
.top-track-card__podium--gold {
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.12);
}
.top-track-card__podium--silver {
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(148, 163, 184, 0.12);
}
.top-track-card__podium--bronze {
    color: #fed7aa;
    border: 1px solid rgba(217, 119, 6, 0.4);
    background: rgba(217, 119, 6, 0.12);
}

.top-track-card__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 640px) {
    .top-track-card__title { font-size: 0.9rem; }
}
.top-track-card__meta {
    margin: 0;
    font-size: 0.65rem;
    color: #6b7280;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 640px) {
    .top-track-card__meta {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
    }
}

.top-track-card__reward {
    padding: 0.3rem 0.4rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.07);
}
.top-track-card__reward-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.575rem;
    color: #fde68a;
}
.top-track-card__reward-label { font-weight: 600; color: #fcd34d; }
.top-track-card__reward-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #fff7ed;
    white-space: nowrap;
}
.top-track-card__reward-time.is-done { color: #6ee7b7; }
.top-track-card__reward-bar {
    margin-top: 0.25rem;
    height: 0.22rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
}
.top-track-card__reward-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #fde68a);
    transition: width 0.9s linear;
}
.top-track-card__reward-fill.is-done {
    background: linear-gradient(90deg, #059669, #34d399);
}
.top-track-card__reward-note {
    display: none;
}
@media (min-width: 640px) {
    .top-track-card__reward-note {
        display: block;
        margin: 0.15rem 0 0;
        font-size: 0.575rem;
        line-height: 1.3;
        color: #a8a29e;
    }
}

.top-track-card__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
@media (min-width: 640px) {
    .top-track-card__footer { gap: 0.4rem; }
}

.top-track-card__vote {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
    padding: 0.15rem 0.2rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(75, 85, 99, 0.65);
    background: rgba(15, 12, 24, 0.5);
}
.top-track-card__vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 1.7rem;
    padding: 0;
    border: none;
    border-radius: 0.35rem;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.15s ease, background 0.15s ease;
}
@media (min-width: 640px) {
    .top-track-card__vote-btn { width: 2.2rem; height: 1.85rem; }
}
.top-track-card__vote-btn svg {
    width: 0.9rem;
    height: 0.9rem;
    stroke-width: 2.25;
}
.top-track-card__vote-btn:hover {
    color: #f3f4f6;
    background: rgba(55, 65, 81, 0.5);
}
.top-track-card__vote-btn.is-up {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
}
.top-track-card__vote-btn.is-down {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}
.top-track-card__score {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #e9d5ff;
    font-variant-numeric: tabular-nums;
}
@media (min-width: 640px) {
    .top-track-card__score { font-size: 1rem; }
}
.top-track-card.is-first .top-track-card__score { color: #fcd34d; }
.top-track-card.is-second .top-track-card__score { color: #e2e8f0; }
.top-track-card.is-third .top-track-card__score { color: #fdba74; }

.top-track-card__share {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.top-track-card__share::-webkit-scrollbar { display: none; }
.top-track-card__share-label {
    display: none;
}
@media (min-width: 640px) {
    .top-track-card__share-label {
        display: inline;
        font-size: 0.6rem;
        color: #6b7280;
        flex-shrink: 0;
    }
}

.top-track-card__msg {
    margin: 0;
    font-size: 0.65rem;
    line-height: 1.3;
}
.top-track-card__msg.is-ok { color: #6ee7b7; }
.top-track-card__msg.is-err { color: #fca5a5; }

.top-page__cta {
    margin-top: 1.15rem;
    text-align: center;
}
@media (min-width: 768px) {
    .top-page__cta { margin-top: 1.4rem; }
}
.top-page__cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 20rem;
    padding: 0.65rem 1.15rem;
    border-radius: 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 40%, #e16252 100%);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
    transition: filter 0.15s ease, transform 0.15s ease;
}
@media (min-width: 640px) {
    .top-page__cta a {
        width: auto;
        font-size: 0.875rem;
        padding: 0.7rem 1.35rem;
    }
}
.top-page__cta a:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .top-track-card,
    .top-page__cta a,
    .top-track-card__play-overlay { transition: none; }
}
