/* ═══════════════════════════════════════════════════════════════
   Richsound — Home / Main app stylesheet
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:             #07080e;
    --panel:          rgba(18, 18, 26, 0.95);
    --panel-soft:     rgba(24, 24, 34, 0.85);
    --stroke:         rgba(255, 255, 255, 0.07);
    --stroke-strong:  rgba(255, 255, 255, 0.13);
    --text:           #f0eef8;
    --muted:          #9896a8;
    --muted-soft:     #6e6c7e;
    --accent:         #8b5cf6;
    --accent-2:       #22d3ee;
    --accent-glow:    rgba(139, 92, 246, 0.38);
    --accent-2-glow:  rgba(34, 211, 238, 0.22);
    --pink:           #f472b6;
    --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-deep:    0 24px 80px rgba(0, 0, 0, 0.6);
    --radius-xl:      32px;
    --radius-lg:      26px;
    --radius-md:      20px;
    --radius-sm:      14px;
    --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    font-family: "Sora", "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(ellipse 80% 50% at -10% -10%, rgba(139, 92, 246, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 110% 0%, rgba(34, 211, 238, 0.11) 0%, transparent 45%),
        radial-gradient(ellipse 50% 50% at 50% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #07080e 0%, #0c0c17 100%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button:disabled, input:disabled { cursor: not-allowed; opacity: 0.5; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.55); }

/* ── Page shell ─────────────────────────────────────────────────── */

.page { padding: 16px; }

/* ── Dashboard layout ──────────────────────────────────────────── */

.dashboard {
    position: relative;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: calc(100vh - 32px);
    background: rgba(7, 8, 14, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 38px;
    box-shadow:
        var(--shadow-deep),
        0 0 0 1px rgba(139, 92, 246, 0.04) inset;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────── */

.dashboard__sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 20px 140px;
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.04) 0%, transparent 40%),
        rgba(11, 11, 18, 0.98);
    border-right: 1px solid var(--stroke);
    position: relative;
}

.dashboard__sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.08), transparent 70%);
    pointer-events: none;
}

/* Brand */
.brand { display: grid; gap: 4px; padding: 4px 8px; }

.brand__title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(120deg, #a78bfa 0%, #818cf8 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand__meta {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-soft);
}

/* Nav groups */
.sidebar__nav,
.sidebar__group {
    display: grid;
    gap: 4px;
}

.sidebar__label {
    margin: 10px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #9096b0;
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.sidebar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity var(--transition);
}

.sidebar__text { flex: 1; }

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar__link:hover .sidebar__icon { opacity: 1; }

.sidebar__link--active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(34, 211, 238, 0.06) 100%);
    border-color: rgba(139, 92, 246, 0.22);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12) inset, 0 4px 16px rgba(139, 92, 246, 0.1);
}

.sidebar__link--active .sidebar__icon { opacity: 1; }

/* Mobile-only create button — hidden on desktop */
.sidebar__link--create { display: none; }

/* Upgrade / Logout button */
.sidebar__upgrade {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #38bdf8 100%);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3), 0 1px 0 rgba(255,255,255,0.12) inset;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition), opacity var(--transition);
    text-decoration: none;
}

.sidebar__upgrade:hover {
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.45), 0 1px 0 rgba(255,255,255,0.12) inset;
    transform: translateY(-1px);
}

.sidebar__upgrade--link { text-decoration: none; }

/* ── Main area ──────────────────────────────────────────────────── */

.dashboard__main {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--stroke);
}

.tabs { display: flex; gap: 24px; min-width: 0; }

.tabs__item {
    position: relative;
    padding-bottom: 12px;
    color: #7a7e96;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition);
}

.tabs__item:hover { color: rgba(255,255,255,0.8); }

.tabs__item--active { color: #ffffff; }

.tabs__item--active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), #a78bfa, var(--accent-2));
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

.tabs__item:focus-visible {
    outline: none;
    color: #fff;
    text-decoration: none;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar__profile { display: grid; gap: 1px; text-align: right; }

.topbar__profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.topbar__profile-role {
    font-size: 11px;
    color: var(--muted-soft);
}

.topbar__auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 99px;
    border: 1px solid var(--stroke-strong);
    color: #d0cde0;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition), border-color var(--transition);
}

.topbar__auth-link:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

.topbar__auth-link--primary {
    color: white;
    border-color: transparent;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #38bdf8 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.topbar__auth-link--primary:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

/* Search */
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 99px;
    color: var(--muted);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s,
                box-shadow 0.2s,
                background 0.2s;
}

.search:focus-within {
    width: 320px;
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: rgba(139, 92, 246, 0.04);
}

.search__field {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    font-size: 13px;
    color: var(--text);
}

.search__field:focus-visible {
    outline: none;
}

.search__field::placeholder { color: var(--muted-soft); }

.topbar__icon-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9096b0;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.topbar__icon-button:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

/* ── Content area ───────────────────────────────────────────────── */

.main__content {
    padding: 20px 24px 144px;
    overflow: auto;
}

/* Alerts */
.alert {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.55;
}

.alert--success {
    color: #d1fae5;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

.alert--error {
    color: #fde0e5;
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.2);
}

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, 0.8fr);
    gap: 20px;
    align-items: stretch;
}

/* Base card look shared by hero banner, mix-card, album art */
.hero__banner,
.mix-card,
.album-card__art,
.track-card,
.dashboard__player {
    border: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(22, 22, 32, 0.95), rgba(14, 14, 22, 0.92));
    backdrop-filter: blur(20px);
}

.hero__banner {
    position: relative;
    min-height: 340px;
    padding: 36px 40px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Background blobs */
.hero__banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 38%, rgba(139, 92, 246, 0.3), transparent 35%),
        radial-gradient(circle at 75% 28%, rgba(34, 211, 238, 0.14), transparent 32%),
        linear-gradient(90deg, rgba(7, 7, 12, 0.88), rgba(7, 7, 12, 0.4));
    pointer-events: none;
}

.hero__banner::after {
    content: '';
    position: absolute;
    right: -4%;
    bottom: -8%;
    width: 52%;
    height: 110%;
    background:
        radial-gradient(circle at 30% 28%, rgba(120, 10, 10, 0.22), transparent 36%),
        radial-gradient(circle at 60% 35%, rgba(160, 40, 40, 0.38), transparent 30%),
        radial-gradient(circle at 50% 66%, rgba(130, 40, 40, 0.48), transparent 26%),
        radial-gradient(circle at 38% 84%, rgba(100, 100, 110, 0.38), transparent 20%);
    opacity: 0.65;
    filter: blur(12px);
    pointer-events: none;
}

.hero__banner > * { position: relative; z-index: 1; }

/* ── Hero slideshow ────────────────────────────────────── */
.hero__slideshow {
    position: relative;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.4s ease;
}

/* Активный слайд — в потоке, задаёт высоту контейнера */
.hero__slide--active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}

/* Hero badge */
.hero__badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 12px;
    border-radius: 99px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.hero__title {
    max-width: 500px;
    margin: 18px 0 10px;
    font-size: clamp(40px, 4.5vw, 68px);
    line-height: 0.96;
    letter-spacing: -0.06em;
    font-weight: 800;
}

.hero__title-accent {
    background: linear-gradient(90deg, #a78bfa 0%, #818cf8 40%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__description {
    max-width: 460px;
    margin: 0;
    color: #a8a4b8;
    font-size: 17px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 99px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition), opacity var(--transition);
}

.button--primary {
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 55%, #22d3ee 100%);
    box-shadow: 0 12px 36px var(--accent-glow);
}

.button--primary:hover {
    box-shadow: 0 16px 48px rgba(139, 92, 246, 0.55);
    transform: translateY(-2px);
}

.button--secondary {
    color: white;
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--stroke-strong);
    backdrop-filter: blur(10px);
}

.button--secondary:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* ── Mix card ───────────────────────────────────────────────────── */

.mix-card {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 16px;
    padding: 28px 24px;
    border-radius: var(--radius-xl);
    text-align: center;
}

.mix-card__badge {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
    box-shadow: 0 16px 40px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

.mix-card__title {
    margin: 4px 0 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.mix-card__description {
    margin: 0;
    color: #8e8aa0;
    line-height: 1.6;
    font-size: 14px;
}

/* ── Section ────────────────────────────────────────────────────── */

.section { margin-top: 40px; }

.section__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.section__marker {
    width: 4px;
    height: 32px;
    border-radius: 99px;
    background: linear-gradient(180deg, #a78bfa, #38bdf8);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
    flex-shrink: 0;
}

.section__title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.section__link {
    margin-left: auto;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 700;
    transition: color var(--transition);
}

.section__link:hover { color: #c4b5fd; }

/* ── Album grid ─────────────────────────────────────────────────── */

.album-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.album-card {
    display: grid;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.album-card:hover { transform: translateY(-6px); }

.album-card__art {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.album-card:hover .album-card__art {
    box-shadow: 0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.album-card__art--media,
.track-card__cover,
.player__art--media {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Decorative album art patterns */
.album-card__art--vinyl-gold {
    background:
        radial-gradient(circle at center, rgba(0,0,0,0.95) 11%, transparent 12%),
        radial-gradient(circle at center, #23200f 23%, transparent 24%),
        radial-gradient(circle at center, #d9be72 34%, #6b5330 46%, #141414 60%, #0a0a0a 72%);
}

.album-card__art--skull {
    background:
        radial-gradient(circle at 52% 54%, #e8d960 0%, #7a6420 11%, transparent 12%),
        radial-gradient(circle at 46% 43%, rgba(210, 170, 74, 0.9), transparent 20%),
        radial-gradient(circle at 58% 58%, rgba(130, 12, 12, 0.9), transparent 12%),
        linear-gradient(180deg, #0c1510, #08090c);
}

.album-card__art--portrait {
    background:
        radial-gradient(circle at 50% 38%, rgba(248, 238, 220, 0.36), transparent 12%),
        radial-gradient(circle at 49% 46%, rgba(20, 50, 56, 0.92), transparent 28%),
        linear-gradient(180deg, #0e221f 0%, #070a0d 100%);
}

.album-card__art--vinyl-mono {
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.9) 6%, transparent 7%),
        radial-gradient(circle at center, #2a2a2a 21%, transparent 22%),
        radial-gradient(circle at center, #101114 40%, #1c1c21 51%, #0a0a0d 66%),
        linear-gradient(180deg, #f0f0f0 0%, #e4e4e4 100%);
}

/* Album cover image overlay on hover */
.album-card__art::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background var(--transition);
    z-index: 1;
}

.album-card:hover .album-card__art::before {
    background: rgba(0,0,0,0.18);
}

/* Album meta */
.album-card__meta { padding: 0 2px; }

.album-card__title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card__artist {
    margin: 0;
    color: #6e6c7e;
    font-size: 14px;
}

.album-card__stats {
    margin: 8px 0 0;
    color: #7e7a91;
    font-size: 13px;
}

/* Album / track play buttons */
.album-card__play,
.track-card__play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 99px;
    cursor: pointer;
}

.album-card__play {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    color: #120d1e;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 2;
    /* Hidden until hover */
    opacity: 0;
    transform: scale(0.7) translateY(6px);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--transition);
}

.album-card:hover .album-card__play {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* На тач-экранах нет hover — кнопку play показываем всегда */
@media (hover: none), (pointer: coarse) {
    .album-card__play {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.album-card__play:hover {
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
    background: white;
}

/* ── Track grid ─────────────────────────────────────────────────── */

.track-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.track-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    border: 1px solid var(--stroke);
}

.track-card:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(34, 211, 238, 0.04));
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(139, 92, 246, 0.12) inset;
    transform: translateY(-2px);
}

/* Track cover placeholder gradients */
.track-card__cover {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.1), transparent),
        radial-gradient(circle at 18% 20%, rgba(255,255,255,0.2), transparent 18%),
        linear-gradient(135deg, #25133f, #7f203d 52%, #0e1f44);
    border: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.track-card__cover--blue {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.07), transparent),
        linear-gradient(135deg, #0a1e39, #184f71 55%, #1ec8f1);
}

.track-card__cover--olive {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.07), transparent),
        linear-gradient(135deg, #18140d, #5b4f1b 55%, #a38d40);
}

.track-card__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-card__artist {
    margin: 0;
    color: #7a7890;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-card__meta {
    display: grid;
    justify-items: end;
    gap: 8px;
    color: #7a7890;
    font-size: 13px;
}

.track-card__play {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #6366f1 55%, #22d3ee);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
    transition: box-shadow var(--transition), transform var(--transition);
}

.track-card__play:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55);
    transform: translateY(-1px);
}

/* ── Track action buttons (like / add to playlist) ──────────────── */

.track-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.track-actions--inline {
    margin-top: 0;
    justify-content: flex-end;
}

.track-actions__like,
.track-actions__add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.track-actions__like:hover,
.track-actions__add:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.track-actions__like--active {
    color: #f472b6;
    border-color: rgba(244, 114, 182, 0.3);
    background: rgba(244, 114, 182, 0.08);
}

.track-actions__like--active:hover {
    background: rgba(244, 114, 182, 0.14);
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.2);
}

.track-actions__likes-count {
    font-size: 12px;
    color: var(--muted-soft);
}

/* Playlist dropdown */
.track-actions__playlist-wrap { position: relative; }

.playlist-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 60;
    min-width: 190px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: #15151e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139,92,246,0.08);
}

.playlist-dropdown[hidden] { display: none; }

.playlist-dropdown li { display: block; }

.playlist-dropdown button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #cac7d8;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.playlist-dropdown button:hover {
    background: rgba(139, 92, 246, 0.12);
    color: #fff;
}

/* ── Empty states ───────────────────────────────────────────────── */

.empty-state {
    padding: 28px 24px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    color: #7a7890;
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   Player bar — Spotify-style (embedded in home dashboard)
   ═══════════════════════════════════════════════════════════════ */

.dashboard__player {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr minmax(160px, 240px);
    align-items: center;
    gap: 0;
    min-height: 90px;
    padding: 0 16px;
    background: #0e0e16;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
}

/* ── Now playing ─────────────────────────────────────────────── */
.player__now {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding-right: 8px;
}

.player__art {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background:
        linear-gradient(135deg, #27131c, #3b1d4e 40%, #ee8340);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.player__info { min-width: 0; flex: 1; }

.player__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    letter-spacing: -0.01em;
}

.player__artist {
    margin: 0;
    font-size: 12px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

/* Generic icon button */
.player__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #b3b3b3;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.player__btn:hover { color: #fff; transform: scale(1.06); }
.player__btn:active { transform: scale(0.95); }
.player__btn:disabled { opacity: 0.35; cursor: default; transform: none !important; }

/* Heart */
.player__btn--heart {
    margin-left: 8px;
    color: #8b5cf6;
}
.player__btn--heart:hover { color: #a78bfa; transform: scale(1.12); }

/* ── Center ──────────────────────────────────────────────────── */
.player__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
}

.player__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Play/pause — white circle */
.player__btn--play {
    width: 40px;
    height: 40px;
    background: #fff;
    color: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.player__btn--play:hover {
    color: #000;
    background: #f0f0f0;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.6);
}

.player__btn--play:active { transform: scale(0.96); }

/* Play/pause icon toggling */
.player__icon-play  { display: block; }
.player__icon-pause { display: none;  }
[data-playing] .player__icon-play  { display: none;  }
[data-playing] .player__icon-pause { display: block; }

/* Pulse while playing */
@keyframes player-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(139, 92, 246, 0.55), 0 4px 16px rgba(0,0,0,0.45); }
    55%       { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0),   0 4px 16px rgba(0,0,0,0.45); }
}
[data-playing] .player__btn--play {
    animation: player-pulse 2.6s ease-out infinite;
}

/* ── Progress bar ────────────────────────────────────────────── */
.player__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.player__time {
    font-size: 11px;
    color: #b3b3b3;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 34px;
    text-align: center;
}

/* ── Slider (shared: progress + volume) ─────────────────────── */
.player__slider {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    cursor: pointer;
}

/* Expand tap area */
.player__slider::before {
    content: '';
    position: absolute;
    inset: -10px 0;
}

.player__slider-rail {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
}

.player__slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--fill, 0%);
    background: #b3b3b3;
    border-radius: 2px;
    pointer-events: none;
}

.player__slider:hover .player__slider-fill { background: #8b5cf6; }

/* Thumb dot on hover */
.player__slider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: var(--fill, 0%);
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
    transition: transform 0.12s ease;
    z-index: 2;
}
.player__slider:hover::after { transform: translate(-50%, -50%) scale(1); }

/* Invisible range on top for interaction */
.player__range {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: calc(4px + 20px);
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
    z-index: 3;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Side: volume ────────────────────────────────────────────── */
.player__side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-left: 8px;
}

.player__slider--vol {
    flex: none;
    width: 93px;
}

/* ═══════════════════════════════════════════════════════════════
   Library page styles (used by user/library.php)
   ═══════════════════════════════════════════════════════════════ */

.lib-shell {
    padding: 24px 0 80px;
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
}

.lib-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.lib-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.05em;
}

.lib-alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}

.lib-alert--success {
    color: #d1fae5;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

.lib-alert--error {
    color: #fde0e5;
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.2);
}

.lib-section { margin-bottom: 52px; }

.lib-section__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.lib-section__marker {
    width: 4px;
    height: 28px;
    border-radius: 99px;
    background: linear-gradient(180deg, #a78bfa, #38bdf8);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
    flex-shrink: 0;
}

.lib-section__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.lib-section__count {
    margin-left: auto;
    color: #a78bfa;
    font-weight: 700;
    font-size: 13px;
}

/* Liked tracks */
.liked-list { display: grid; gap: 8px; }

.liked-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: var(--panel-soft);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.liked-item:hover {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.16);
    transform: translateX(4px);
}

.liked-item__cover {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #25133f, #7f203d 52%, #0e1f44);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.liked-item__info { min-width: 0; }

.liked-item__title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.liked-item__meta {
    margin: 0;
    font-size: 12px;
    color: var(--muted-soft);
}

.liked-item__unlike {
    border: 0;
    background: transparent;
    color: #f472b6;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

.liked-item__unlike:hover {
    background: rgba(244, 114, 182, 0.12);
    transform: scale(1.15);
}

/* Playlist create form */
.playlist-create-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.playlist-create-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 11px 16px;
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.playlist-create-form input[type="text"]:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.playlist-create-form .checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.playlist-create-form .btn-create {
    padding: 11px 22px;
    border: 0;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
    transition: box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
}

.playlist-create-form .btn-create:hover {
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.55);
    transform: translateY(-1px);
}

/* Playlists grid */
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.playlist-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: var(--panel-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.playlist-card:hover {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.playlist-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.playlist-card__meta {
    margin: 0;
    font-size: 12px;
    color: var(--muted-soft);
}

.playlist-card__badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.14);
    color: #a78bfa;
    width: fit-content;
}

.playlist-card__badge--private {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.playlist-card__footer { display: flex; gap: 8px; margin-top: auto; }

.playlist-card__del {
    border: 0;
    background: rgba(244, 114, 182, 0.1);
    color: #f9a8d4;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.playlist-card__del:hover { background: rgba(244, 114, 182, 0.2); }

/* Subscriptions */
.sub-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 14px;
}

.sub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: var(--panel-soft);
    text-align: center;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.sub-card:hover {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.sub-card__avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.sub-card__name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.sub-card__meta {
    margin: 0;
    font-size: 12px;
    color: var(--muted-soft);
}

.sub-card__unsub {
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.sub-card__unsub:hover {
    background: rgba(244, 114, 182, 0.14);
    color: #f9a8d4;
}

/* Empty state for library */
.lib-empty {
    padding: 28px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--muted-soft);
    text-align: center;
    font-size: 14px;
    line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
    .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .track-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .dashboard { grid-template-columns: 1fr; }

    .dashboard__sidebar {
        gap: 16px;
        padding-bottom: 22px;
        border-right: 0;
        border-bottom: 1px solid var(--stroke);
    }

    .sidebar__upgrade { margin-top: 6px; }

    .hero { grid-template-columns: 1fr; }

    .dashboard__player {
        position: static;
        grid-template-columns: minmax(180px, 240px) 1fr minmax(130px, 180px);
        padding: 0 14px;
    }

    .main__content { padding-bottom: 28px; }
}

/* ── Mobile: 760px and below ─────────────────────────────────────
   Bottom nav + fixed mini player
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .page { padding: 0; }

    /* Prevent horizontal overflow */
    html, body { overflow-x: hidden; }

    .dashboard {
        min-height: 100vh;
        border-radius: 0;
        /* mini-player(62px) + bottom-nav(64px) + safe-area */
        padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Bottom nav bar ────────────────────────────────────────── */
    .dashboard__sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding: 0 env(safe-area-inset-bottom, 0px);
        gap: 0;
        background: #121212;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-bottom: 0;
        border-right: 0;
    }

    /* Hide brand, groups, labels, logout form */
    .dashboard__sidebar .brand,
    .dashboard__sidebar .sidebar__group,
    .dashboard__sidebar .sidebar__label,
    .dashboard__sidebar form,
    .dashboard__sidebar .sidebar__upgrade { display: none; }

    /* Hide Подкасты (5th) and Эфиры (6th) from nav */
    .sidebar__nav .sidebar__link:nth-child(n+5) { display: none; }

    /* Show Создать button on mobile */
    .sidebar__link--create { display: flex; }

    .sidebar__nav {
        display: contents;
    }

    .sidebar__nav .sidebar__link {
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        border-radius: 0;
        border: 0;
        background: transparent;
        min-height: 44px;
        color: #a7a7a7;
        position: relative;
        text-decoration: none;
    }

    .sidebar__nav .sidebar__icon { width: 24px; height: 24px; opacity: 1; color: inherit; }

    .sidebar__nav .sidebar__text {
        display: block;
        font-size: 10px;
        font-weight: 500;
        line-height: 1;
        color: inherit;
        letter-spacing: 0.01em;
    }

    .sidebar__nav .sidebar__link--active,
    .sidebar__nav .sidebar__link:hover { background: transparent; color: #fff; }

    .sidebar__nav .sidebar__link--active .sidebar__text,
    .sidebar__nav .sidebar__link:hover .sidebar__text { font-weight: 700; }

    /* ── Mini player ───────────────────────────────────────────── */
    .dashboard__player {
        position: fixed;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        z-index: 200;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        min-height: 62px;
        border-radius: 0;
        background: rgba(10, 10, 18, 0.99);
        backdrop-filter: blur(28px);
        -webkit-backdrop-filter: blur(28px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Now playing: takes all remaining space */
    .dashboard__player .player__now {
        flex: 1;
        min-width: 0;
        gap: 10px;
        padding-right: 0;
    }

    .player__art { width: 42px; height: 42px; border-radius: 4px; flex-shrink: 0; }

    .player__title {
        font-size: 13px;
        margin: 0 0 2px;
    }

    .player__artist { font-size: 11px; color: #b3b3b3; }

    /* Hide heart, shuffle, repeat on mini player */
    .player__btn--heart,
    .player__btn--shuffle,
    .player__btn--repeat { display: none; }

    /* Controls: only prev/play/next, compact */
    .dashboard__player .player__center {
        display: flex;
        align-items: center;
        padding: 0;
        flex-shrink: 0;
    }

    /* Hide progress bar on mini player */
    .dashboard__player .player__bar { display: none; }

    .player__controls { gap: 4px; }

    .player__btn--prev,
    .player__btn--next { width: 36px; height: 36px; }

    .player__btn--play {
        width: 40px;
        height: 40px;
        box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.1), 0 4px 12px rgba(0,0,0,0.5);
    }

    /* Hide side (volume) on mini player */
    .dashboard__player .player__side { display: none; }

    /* Mini player: now-playing area opens full-screen player on tap */
    .dashboard__player .player__now { cursor: pointer; }

    /* ── Topbar ────────────────────────────────────────────────── */
    .topbar {
        flex-wrap: wrap;
        padding: 12px 16px 8px;
        gap: 10px;
        border-bottom: 1px solid var(--stroke);
    }

    /* Tabs scroll horizontally */
    .tabs {
        order: 1;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 20px;
        padding-bottom: 2px;
    }

    .tabs::-webkit-scrollbar { display: none; }

    .tabs__item {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 13px;
    }

    /* Actions: search + profile/auth */
    .topbar__actions {
        order: 2;
        width: 100%;
        margin-left: 0;
        gap: 8px;
    }

    .search {
        flex: 1;
        width: auto;
        min-width: 0;
        padding: 9px 14px;
    }

    .topbar__profile-role { display: none; }

    .topbar__auth-link { min-height: 36px; padding: 0 14px; font-size: 12px; }

    /* ── Content ───────────────────────────────────────────────── */
    .main__content {
        padding: 16px 14px 20px;
    }

    /* Hero */
    .hero__banner {
        min-height: unset;
        padding: 22px 20px;
        border-radius: 20px;
    }

    .hero__title { font-size: 34px; }

    .hero__description { font-size: 15px; }

    .hero__actions { gap: 10px; }

    .button { min-height: 46px; padding: 0 22px; font-size: 15px; }

    /* Mix card: hidden on narrow mobile (saves vertical space) */
    .hero__mix { display: none; }

    /* Section */
    .section { margin-top: 28px; }
    .section__title { font-size: 22px; }

    /* Album grid: 2 columns */
    .album-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* Track cards: simplified 2-col layout */
    .track-card {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
        border-radius: 16px;
    }

    .track-card__cover { width: 56px; height: 56px; border-radius: 12px; }

    .track-card__meta {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        justify-items: unset;
    }

    .track-card__meta > span { font-size: 12px; }

    .track-card__play {
        min-height: 32px;
        padding: 0 12px;
        font-size: 12px;
        margin-right: auto;
    }

    /* Touch-friendly action buttons */
    .track-actions__like,
    .track-actions__add {
        min-height: 44px;
        padding: 0 14px;
    }

    /* ── Library mobile ────────────────────────────────────────── */
    .lib-shell {
        width: 100%;
        padding: 16px 14px 40px;
    }

    .lib-section { margin-bottom: 36px; }

    .liked-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .liked-item__cover { width: 44px; height: 44px; border-radius: 10px; }

    .playlist-create-form { gap: 8px; }

    .playlists-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .sub-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* ── Very small phones: 380px ───────────────────────────────────── */
@media (max-width: 380px) {
    .hero__title { font-size: 26px; }

    .album-grid { grid-template-columns: 1fr; gap: 12px; }

    .playlists-grid,
    .sub-list { grid-template-columns: 1fr; }

    .album-card__title { font-size: 15px; }

    /* Search: full width on its own line */
    .topbar__actions { flex-wrap: wrap; }
    .search,
    .search:focus-within { flex: 0 0 100%; width: 100%; }

    /* Smaller track card */
    .track-card {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 10px;
    }
    .track-card__cover { width: 48px; height: 48px; }
    .track-card__title { font-size: 13px; }

    /* Mini player tighter */
    .dashboard__player { gap: 8px; padding: 8px 12px; }
}

/* ── Search dropdown ────────────────────────────────────── */
.search { position: relative; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: #12121c;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
    z-index: 200;
}

.search-dd__label {
    padding: 10px 16px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.3);
    margin: 0;
}

.search-dd__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    text-decoration: none;
    color: #f0eef8;
    transition: background .15s;
}

.search-dd__item:hover,
.search-dd__item:active { background: rgba(255,255,255,.06); }

.search-dd__cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: #1a0a2e;
    background-size: cover;
    background-position: center;
}

.search-dd__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #27131c, #8b5cf6);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,.7);
}

.search-dd__info { display: flex; flex-direction: column; min-width: 0; }

.search-dd__title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dd__meta { font-size: 11px; color: rgba(255,255,255,.4); }

.search-dd__all {
    display: block;
    padding: 10px 16px;
    font-size: 12px;
    color: #8b5cf6;
    text-decoration: none;
    border-top: 1px solid rgba(255,255,255,.07);
    transition: background .15s;
}

.search-dd__all:hover,
.search-dd__all:active { background: rgba(139,92,246,.08); }

/* ── Search page hero ───────────────────────────────────── */
.search-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.search-hero__icon {
    width: 64px;
    height: 64px;
    color: rgba(255,255,255,.2);
    margin-bottom: 20px;
}

.search-hero__title {
    font-size: 24px;
    font-weight: 700;
    color: #f0eef8;
    margin: 0 0 10px;
}

.search-hero__sub {
    font-size: 15px;
    color: rgba(255,255,255,.4);
    margin: 0;
}

/* ── Search authors grid ────────────────────────────────── */
.search-authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.search-author-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255,255,255,.04);
    border-radius: 14px;
    text-decoration: none;
    color: #f0eef8;
    transition: background .2s, transform .15s;
}

.search-author-card:hover {
    background: rgba(255,255,255,.08);
    transform: translateY(-2px);
}

.search-author-card__avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #27131c, #8b5cf6);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,.8);
}

.search-author-card__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

.search-author-card__meta {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    margin: 0;
}

/* Topbar search wrap */
.topbar__search-wrap { flex: 1; max-width: 400px; }

/* ── Roles section (guest only) ─────────────────────────────────── */

.roles-section {
    margin-bottom: 48px;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) { .roles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .roles-grid { grid-template-columns: 1fr; } }

.role-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel-soft);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 24px 20px 20px;
    gap: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.role-card:hover {
    border-color: var(--stroke-strong);
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

/* Author card — accent glow */
.role-card--author {
    border-color: rgba(139, 92, 246, 0.35);
    background: linear-gradient(145deg, rgba(139,92,246,0.08) 0%, var(--panel-soft) 100%);
    box-shadow: 0 0 0 1px rgba(139,92,246,0.2), 0 12px 40px rgba(139,92,246,0.12);
}
.role-card--author:hover {
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 0 0 1px rgba(139,92,246,0.35), 0 16px 48px rgba(139,92,246,0.18);
}

/* Guest card — dimmer */
.role-card--guest { opacity: 0.75; }
.role-card--guest:hover { opacity: 1; }

/* Admin card — cyan accent */
.role-card--admin {
    border-color: rgba(34, 211, 238, 0.2);
}
.role-card--admin:hover {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 8px 40px rgba(34,211,238,0.08);
}

/* Badge */
.role-card__badge {
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--panel);
    border: 1px solid var(--stroke-strong);
    color: var(--muted);
}
.role-card__badge--muted {
    background: rgba(110,108,126,0.25);
    color: var(--muted);
    border-color: rgba(110,108,126,0.35);
}
.role-card__badge--accent {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Icon */
.role-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    flex-shrink: 0;
}
.role-card--listener .role-card__icon { color: var(--accent-2); background: rgba(34,211,238,0.08); }
.role-card--author   .role-card__icon { color: var(--accent);   background: rgba(139,92,246,0.12); }
.role-card--admin    .role-card__icon { color: var(--accent-2); background: rgba(34,211,238,0.08); }

/* Name */
.role-card__name {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

/* Description */
.role-card__desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 16px;
    line-height: 1.55;
}

/* Perks list */
.role-card__perks {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

.perk {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
}
.perk::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: 8px;
    background-position: center;
    background-repeat: no-repeat;
}
.perk--ok {
    color: rgba(240, 238, 248, 0.8);
}
.perk--ok::before {
    background-color: rgba(139,92,246,0.25);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.perk--no::before {
    background-color: rgba(110,108,126,0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%236e6c7e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

/* CTA button */
.role-card__cta {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--stroke-strong);
    color: var(--muted);
    background: rgba(255,255,255,0.04);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    margin-top: auto;
    text-decoration: none;
}
.role-card__cta:hover {
    background: rgba(255,255,255,0.09);
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
}
.role-card__cta--accent {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.4);
}
.role-card__cta--accent:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #ede9fe;
    border-color: rgba(139, 92, 246, 0.65);
}

/* Note (admin — no self-signup) */
.role-card__note {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--muted-soft);
    padding: 10px 0 2px;
    margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════════
   Design improvements — focus, active, alerts, UX polish
   ═══════════════════════════════════════════════════════════════ */

/* ── Global focus-visible reset ─────────────────────────────────── */
:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.65);
    outline-offset: 2px;
}

/* ── Sidebar links ──────────────────────────────────────────────── */
.sidebar__link:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    box-shadow: inset 0 0 0 1.5px rgba(139, 92, 246, 0.45);
}

.sidebar__upgrade:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5),
                0 8px 24px rgba(139, 92, 246, 0.3);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.button--primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5),
                0 12px 36px var(--accent-glow);
}

.button--primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.button--secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.button--secondary:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.05);
}

/* ── Topbar buttons ─────────────────────────────────────────────── */
.topbar__auth-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
}

.topbar__icon-button:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ── Album card (role=button) ───────────────────────────────────── */
.album-card:focus-visible {
    outline: none;
}
.album-card:focus-visible .album-card__art {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.55),
                0 20px 48px rgba(0, 0, 0, 0.5);
}

.album-card__play:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.55), 0 12px 32px rgba(139, 92, 246, 0.4);
}

/* ── Track card ─────────────────────────────────────────────────── */
.track-card:focus-visible {
    outline: none;
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.track-card__play:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5), 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* ── Track action buttons ───────────────────────────────────────── */
.track-actions__like:focus-visible,
.track-actions__add:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45);
}

/* ── Playlist dropdown ──────────────────────────────────────────── */
.playlist-dropdown button:focus-visible {
    outline: none;
    background: rgba(139, 92, 246, 0.14);
    color: #fff;
}

/* ── Library elements ───────────────────────────────────────────── */
.liked-item__unlike:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.5);
}

.sub-card__unsub:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.playlist-card__del:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.4);
}

.playlist-create-form .btn-create:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5),
                0 6px 22px rgba(139, 92, 246, 0.45);
}

/* ── Alert improvements — left accent border ─────────────────────── */
.alert--success,
.alert--error,
.lib-alert--success,
.lib-alert--error {
    border-left-width: 3px;
    padding-left: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert--success::before,
.lib-alert--success::before {
    content: '✓';
    font-size: 13px;
    font-weight: 800;
    color: #34d399;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert--error::before,
.lib-alert--error::before {
    content: '!';
    font-size: 13px;
    font-weight: 800;
    color: #f472b6;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert--success,
.lib-alert--success {
    border-left-color: rgba(52, 211, 153, 0.55);
}

.alert--error,
.lib-alert--error {
    border-left-color: rgba(244, 114, 182, 0.5);
}

/* ── Enhanced empty states ──────────────────────────────────────── */
.empty-state {
    padding: 44px 24px;
    background: rgba(255, 255, 255, 0.015);
}

.lib-empty {
    padding: 36px 20px;
    background: rgba(255, 255, 255, 0.015);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── Topbar profile refinement ──────────────────────────────────── */
.topbar__profile {
    gap: 2px;
    align-items: flex-end;
}

.topbar__profile-name {
    letter-spacing: -0.02em;
}

.topbar__profile-role {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── Playlist card badges — use variable ────────────────────────── */
.playlist-card__badge { color: var(--accent); }

/* ── Track grid responsive — add 900px breakpoint ──────────────── */
@media (max-width: 900px) and (min-width: 761px) {
    .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Search field — clear button (WebKit) ───────────────────────── */
.search__field::-webkit-search-cancel-button { display: none; }

/* ── Topbar search — show on mobile ────────────────────────────── */
@media (max-width: 760px) {
    .topbar__actions { gap: 8px; }
    .topbar__profile-role { display: none; }
}

/* ── Search dropdown keyboard nav ───────────────────────────────── */
.search-dd__item:focus-visible,
.search-dd__all:focus-visible {
    outline: none;
    background: rgba(139, 92, 246, 0.12);
    color: #fff;
}

/* ── Search author cards ─────────────────────────────────────────── */
.search-author-card:focus-visible {
    outline: none;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45);
}

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR — «Скоро» badge
   ════════════════════════════════════════════════════════════════════ */
.sidebar__soon {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(139, 92, 246, .13);
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: 6px;
    padding: 2px 6px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════
   COMING SOON PAGE
   ════════════════════════════════════════════════════════════════════ */
.coming-page {
    display: flex;
    flex-direction: column;
    gap: 44px;
    padding-bottom: 32px;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.coming-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 40px 44px;
    background: linear-gradient(135deg, rgba(139,92,246,.07) 0%, rgba(34,211,238,.03) 100%);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 28px;
}

.coming-hero::before {
    content: '';
    position: absolute;
    top: -90px;
    right: -90px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(139,92,246,.11) 0%, transparent 70%);
    pointer-events: none;
}

.coming-hero__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(139,92,246,.18) 0%, rgba(34,211,238,.09) 100%);
    border: 1px solid rgba(139,92,246,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 4px;
}

.coming-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(139,92,246,.11);
    border: 1px solid rgba(139,92,246,.26);
    border-radius: 20px;
    padding: 4px 12px;
}

.coming-hero__badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: badge-dot 2s ease-in-out infinite;
}

@keyframes badge-dot {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: .45; transform: scale(.8); }
}

.coming-hero__title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1.1;
    margin: 0;
}

.coming-hero__sub {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.65;
    max-width: 560px;
    margin: 0;
}

/* ── Features grid ───────────────────────────────────────────────── */
.coming-feats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .coming-feats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .coming-feats { grid-template-columns: 1fr; }
}

.coming-feat {
    padding: 24px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background .2s, border-color .2s;
}

.coming-feat:hover {
    background: rgba(255,255,255,.05);
    border-color: rgba(139,92,246,.22);
}

.coming-feat__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(139,92,246,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.coming-feat--cyan .coming-feat__icon {
    background: rgba(34,211,238,.08);
    color: var(--accent-2);
}

.coming-feat__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.coming-feat__desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

/* ── Ghost preview ───────────────────────────────────────────────── */
.coming-preview__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.coming-preview__marker {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    flex-shrink: 0;
    opacity: .45;
}

.coming-preview__label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.28);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.coming-preview__grid--square {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1100px) {
    .coming-preview__grid--square { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
    .coming-preview__grid--square { grid-template-columns: repeat(2, 1fr); }
}

.coming-preview__grid--wide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 760px) {
    .coming-preview__grid--wide { grid-template-columns: 1fr; }
}

/* Ghost card */
.coming-ghost {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    pointer-events: none;
    user-select: none;
}

.coming-ghost::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent               0%,
        rgba(255,255,255,.055)   50%,
        transparent             100%
    );
    background-size: 200% 100%;
    animation: ghost-shimmer 2.4s ease-in-out infinite;
}

@keyframes ghost-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Square ghost card — podcast shows */
.coming-ghost--square {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coming-ghost__art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: rgba(255,255,255,.07);
}

.coming-ghost__lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.coming-ghost__line {
    height: 10px;
    border-radius: 5px;
    background: rgba(255,255,255,.08);
}

.coming-ghost__line--lg { width: 78%; height: 12px; }
.coming-ghost__line--md { width: 52%; }
.coming-ghost__line--sm { width: 34%; height: 8px; }

/* Wide ghost card — live broadcasts */
.coming-ghost--wide {
    display: flex;
    flex-direction: column;
}

.coming-ghost__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(255,255,255,.07);
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
}

.coming-ghost__live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    background: rgba(0,0,0,.5);
    border-radius: 6px;
    padding: 3px 8px;
}

.coming-ghost__live-pill::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(239,68,68,.5);
    flex-shrink: 0;
}

.coming-ghost__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coming-ghost__viewers {
    display: flex;
    gap: 7px;
    align-items: center;
}

.coming-ghost__viewers-dot {
    width: 22px;
    height: 8px;
    border-radius: 4px;
    background: rgba(239,68,68,.18);
}

.coming-ghost__viewers-text {
    width: 56px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,.06);
}

/* ── Pagination ──────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 4px 0;
}
.pagination__btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 20px;
    background: rgba(139,92,246,.15);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s;
}
.pagination__btn:hover { background: rgba(139,92,246,.3); }
.pagination__info {
    font-size: .82rem;
    color: rgba(255,255,255,.45);
}

/* ═══════════════════════════════════════════════════════════════
   Медиатека (Spotify-style library)
   ═══════════════════════════════════════════════════════════════ */

.medialib {
    max-width: 760px;
    padding: 0 0 120px;
}

/* Head */
.medialib__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 28px 0 16px;
}
.medialib__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.medialib__add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.1);
    color: var(--text);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    transition: background var(--transition);
}
.medialib__add-btn:hover { background: rgba(255,255,255,.2); }

/* Filter chips */
.medialib__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.medialib__chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.08);
    color: var(--text);
    font-size: .82rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.medialib__chip:hover { background: rgba(255,255,255,.16); }
.medialib__chip--active {
    background: var(--text);
    color: #07080e;
}

/* Search */
.medialib__search-wrap {
    position: relative;
    margin-bottom: 8px;
}
.medialib__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.4);
    pointer-events: none;
}
.medialib__search {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,.07);
    color: var(--text);
    font-size: .88rem;
    font-family: inherit;
    outline: none;
    transition: background var(--transition);
}
.medialib__search:focus { background: rgba(255,255,255,.12); }
.medialib__search::placeholder { color: rgba(255,255,255,.35); }

/* Inline create form */
.medialib__create-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 10px;
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(139,92,246,.25);
    flex-wrap: wrap;
}
.medialib__create-form input[type="text"] {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,.08);
    color: var(--text);
    font-size: .88rem;
    font-family: inherit;
    outline: none;
}
.medialib__create-form input[type="text"]:focus { background: rgba(255,255,255,.14); }
.medialib__create-form select {
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,.08);
    color: var(--text);
    font-size: .85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}
.medialib__create-form select option { background: #1a1a2e; }
.medialib__create-form button[type="submit"] {
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
}
.medialib__create-form button[type="submit"]:hover { opacity: .85; }

/* Rows list */
.medialib__list {
    display: flex;
    flex-direction: column;
}

.medialib__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 8px 8px 4px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
    text-decoration: none;
    color: inherit;
}
.medialib__row:hover { background: rgba(255,255,255,.06); }
.medialib__row--open { background: rgba(139,92,246,.08); }

/* Art (album cover / avatar) */
.medialib__art {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: rgba(255,255,255,.08);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255,255,255,.4);
}
.medialib__art--round { border-radius: 50%; }
.medialib__art--gradient {
    background: linear-gradient(135deg, #3d2b72 0%, #8b5cf6 100%);
}
.medialib__art--gradient2 { background: linear-gradient(135deg, #1a4060 0%, #22d3ee 100%); }
.medialib__art--gradient3 { background: linear-gradient(135deg, #5a1a3a 0%, #f472b6 100%); }
.medialib__art--gradient4 { background: linear-gradient(135deg, #1a3a20 0%, #4ade80 100%); }

/* Info */
.medialib__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.medialib__name {
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.medialib__sub {
    font-size: .8rem;
    color: rgba(255,255,255,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge */
.medialib__badge {
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.55);
    white-space: nowrap;
    flex-shrink: 0;
}
.medialib__badge--private {
    background: rgba(244,114,182,.12);
    color: rgba(244,114,182,.8);
}

/* Dot-menu (three dots) */
.medialib__dot-menu {
    position: relative;
    flex-shrink: 0;
}
.medialib__dot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    font-size: 1.1rem;
    line-height: 1;
}
.medialib__row:hover .medialib__dot-btn { opacity: 1; }
.medialib__dot-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.medialib__ctx-menu {
    position: absolute;
    right: 0;
    top: 36px;
    z-index: 50;
    min-width: 160px;
    background: #1e1e2e;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    padding: 4px;
    display: flex;
    flex-direction: column;
}
.medialib__ctx-menu button,
.medialib__ctx-menu a {
    padding: 9px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: .85rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: background var(--transition);
}
.medialib__ctx-menu button:hover,
.medialib__ctx-menu a:hover { background: rgba(255,255,255,.08); }
.medialib__ctx-menu button.danger { color: #f87171; }
.medialib__ctx-menu button.danger:hover { background: rgba(248,113,113,.1); }

/* Expandable liked-panel */
.medialib__liked-panel {
    border-radius: 10px;
    background: rgba(139,92,246,.06);
    border: 1px solid rgba(139,92,246,.14);
    margin: 0 4px 4px;
    overflow: hidden;
}

/* Compact liked track row */
.liked-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background var(--transition);
}
.liked-row:last-child { border-bottom: none; }
.liked-row:hover { background: rgba(255,255,255,.04); }
.liked-row__cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: rgba(255,255,255,.08);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.liked-row__info {
    flex: 1;
    min-width: 0;
}
.liked-row__title {
    font-size: .88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 2px;
}
.liked-row__meta {
    font-size: .77rem;
    color: rgba(255,255,255,.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.liked-row__unlike {
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: .7;
    transition: opacity var(--transition);
    flex-shrink: 0;
}
.liked-row__unlike:hover { opacity: 1; }

/* Empty state */
.medialib__empty {
    padding: 20px 8px;
    color: rgba(255,255,255,.4);
    font-size: .88rem;
}
.medialib__empty a { color: var(--accent); text-decoration: none; }
.medialib__empty a:hover { text-decoration: underline; }

/* Alert */
.lib-alert {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: .88rem;
}
.lib-alert--success { background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.lib-alert--error   { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.25); }

/* ═══════════════════════════════════════════════════════════════
   Mobile full-screen player
   Only active on ≤760px — hidden entirely on desktop
   ═══════════════════════════════════════════════════════════════ */

/* Hidden on desktop */
.mobile-player { display: none; }

@media (max-width: 760px) {

/* Lock scroll when player is open */
body.mplayer-open { overflow: hidden; }

/* ── Shell ─────────────────────────────────────────────────── */
.mobile-player {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 500;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-player--open { transform: translateY(0); }

/* ── Blurred background ────────────────────────────────────── */
.mplayer__bg {
    position: absolute;
    inset: -60px;
    z-index: 0;
    background-color: #1a0a2e;
    background-size: cover;
    background-position: center;
    filter: blur(90px) brightness(0.22) saturate(2.5);
}

/* Dark gradient — heavy at top so header is readable */
.mplayer__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(7, 8, 14, 0.72)  0%,
        rgba(7, 8, 14, 0.58) 30%,
        rgba(7, 8, 14, 0.72) 60%,
        rgba(7, 8, 14, 0.96) 100%
    );
    pointer-events: none;
}

/* ── Scrollable content ────────────────────────────────────── */
.mplayer__content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mplayer__content::-webkit-scrollbar { display: none; }

/* ── Main section — fills exactly one screen ───────────────── */
.mplayer__main {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 24px
             calc(env(safe-area-inset-bottom, 0px) + 20px);
    box-sizing: border-box;
}

/* ── Header ────────────────────────────────────────────────── */
.mplayer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.mplayer__header-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

/* ── Shared icon button ────────────────────────────────────── */
.mplayer__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.1s;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.mplayer__icon-btn:active { transform: scale(0.88); opacity: 0.6; }

/* ── Cover art — grows to fill remaining space ─────────────── */
.mplayer__art-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    min-height: 160px;
    max-height: 380px;
}

.mplayer__art {
    width: min(calc(100vw - 48px), 300px);
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #27131c 0%, #3b1d4e 45%, #6b2080 100%);
    background-size: cover;
    background-position: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.6),
        0  6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

.mobile-player--playing .mplayer__art {
    transform: scale(1.04);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 28px 72px rgba(0, 0, 0, 0.7),
        0 10px 28px rgba(0, 0, 0, 0.5);
}

/* ── Meta: title + artist + heart ─────────────────────────── */
.mplayer__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px 0 10px;
}

.mplayer__info { flex: 1; min-width: 0; }

.mplayer__title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.mplayer__artist {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mplayer__heart.is-liked { color: var(--accent); }

/* ── Progress bar ──────────────────────────────────────────── */
.mplayer__progress {
    flex-shrink: 0;
    padding-bottom: 8px;
}

.mplayer__slider {
    position: relative;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 6px;
    cursor: pointer;
}

.mplayer__slider-rail {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
}

.mplayer__slider-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    border-radius: 2px;
    background: #fff;
    pointer-events: none;
    transition: width 0.08s linear;
}

.mplayer__slider-fill::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.15s;
}

.mplayer__slider:active .mplayer__slider-fill::after { opacity: 1; }

.mplayer__range {
    position: absolute;
    inset: -12px 0;
    width: 100%;
    height: calc(100% + 24px);
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.mplayer__times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Controls ──────────────────────────────────────────────── */
.mplayer__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 4px 0 10px;
}

.mplayer__skip { color: #fff; }

.mplayer__play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    border: 0;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s, opacity 0.12s;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.mplayer__play-btn:active { transform: scale(0.92); opacity: 0.85; }

.mplayer__icon-pause { display: none; }
.mobile-player--playing .mplayer__icon-play  { display: none; }
.mobile-player--playing .mplayer__icon-pause { display: block; }

.mplayer__icon-btn.is-active { color: var(--accent); }

/* ── Volume ────────────────────────────────────────────────── */
.mplayer__volume {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
    padding-top: 2px;
}

.mplayer__vol-track {
    flex: 1;
    position: relative;
    height: 4px;
    border-radius: 2px;
}

.mplayer__vol-rail {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.mplayer__vol-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

/* ── Queue (scroll to reveal) ──────────────────────────────── */
.mplayer__queue {
    padding: 24px 24px calc(env(safe-area-inset-bottom, 0px) + 28px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mplayer__queue-header {
    margin-bottom: 8px;
}

.mplayer__queue-title-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mplayer__queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mplayer__queue-item:active { opacity: 0.6; }

.mplayer__queue-item--active .mplayer__queue-track { color: var(--accent, #8b5cf6); }

.mplayer__queue-item--skeleton { opacity: 0.25; pointer-events: none; }

.mplayer__queue-cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2a1040 0%, #3b1d4e 100%);
    background-size: cover;
    background-position: center;
}

.mplayer__queue-info { flex: 1; min-width: 0; }

.mplayer__queue-track {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mplayer__queue-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mplayer__queue-dur {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

} /* end @media (max-width: 760px) — mobile player */
