/* === ОБЩИЕ СТИЛИ МУЗЫКАЛЬНОГО ХАБА === */
.music-hub-body {
    background-color: var(--bg-main, #f8f9fa);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary, #000);
    transition: background 0.3s;
}

@media (prefers-color-scheme: dark) {
    .music-hub-body { background-color: #000000; color: #ffffff; }
}

/* Ограничение ширины для ПК-версии (Стандарт 2026) */
.music-app-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    min-height: 100dvh;
    background-color: inherit;
    box-shadow: 0 0 40px rgba(0,0,0,0.03);
}

@media (prefers-color-scheme: dark) {
    .music-app-wrapper {
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
}

/* Шапка раздела */
.music-header-glass {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(60px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 0.5px solid rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .music-header-glass {
        background: rgba(0, 0, 0, 0.7);
        border-bottom: 0.5px solid rgba(255,255,255,0.05);
    }
}

.music-title { font-size: 20px; margin: 0; letter-spacing: -0.5px; }

/* Кнопки в шапке */
.header-actions { display: flex; align-items: center; gap: 15px; }
.music-search-btn { background: transparent; border: none; font-size: 20px; color: inherit; cursor: pointer; }

/* Пульсирующая неоновая кнопка добавления */
.music-add-btn {
    background: linear-gradient(135deg, #6b48ff, #ff2b54);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(107, 72, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}
.music-add-btn::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    animation: pulse-glow 3s infinite linear;
}
.music-add-btn:active { transform: scale(0.9); }
@keyframes pulse-glow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Секции */
.music-main-container { padding: 20px; }
.section-title { font-size: 18px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* === АРТИСТЫ (КРУЖОЧКИ) === */
.artist-horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.artist-horizontal-scroll::-webkit-scrollbar { display: none; }

.artist-card {
    width: 100px;
    flex-shrink: 0;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}
.artist-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(128,128,128,0.1);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e8e;
    font-size: 32px;
}
.artist-card:active .artist-avatar, .artist-card:hover .artist-avatar {
    transform: scale(0.92);
}
.artist-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === АЛЬБОМЫ (КВАДРАТЫ) === */
.album-horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.album-horizontal-scroll::-webkit-scrollbar { display: none; }

.album-card {
    width: 140px;
    flex-shrink: 0;
    cursor: pointer;
}
.album-cover {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    background: rgba(128,128,128,0.1);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e8e;
    font-size: 32px;
    position: relative;
    overflow: hidden;
}
.album-card:active .album-cover, .album-card:hover .album-cover {
    transform: scale(0.92);
}
.album-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-artist {
    font-size: 12px;
    color: #8e8e8e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Горизонтальные плейлисты */
.playlist-horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.playlist-horizontal-scroll::-webkit-scrollbar { display: none; }

.playlist-card { width: 140px; flex-shrink: 0; cursor: pointer; position: relative; }
.playlist-cover {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.playlist-card:active .playlist-cover { transform: scale(0.92); }
.play-overlay { color: #fff; font-size: 32px; opacity: 0; transition: opacity 0.2s; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); z-index: 2; }
.playlist-card:hover .play-overlay { opacity: 0.9; }

/* Кнопка удаления плейлиста */
.playlist-delete-btn {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10;
}
.playlist-card:hover .playlist-delete-btn { opacity: 1; }
.playlist-delete-btn:hover { background: #ff4757; transform: scale(1.1); }

.playlist-info { margin-top: 10px; }
.playlist-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-desc { font-size: 11px; color: #8e8e8e; display: none; }

/* Вертикальный список треков */
.track-list-vertical { display: flex; flex-direction: column; gap: 12px; min-height: 100px; }
.track-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(128,128,128,0.03);
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
}
.track-item:active { background: rgba(128,128,128,0.08); }

.track-cover {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
.default-music-icon { color: rgba(255,255,255,0.2); font-size: 18px; }

/* === АНИМИРОВАННЫЙ ЭКВАЛАЙЗЕР И АКТИВНЫЙ ТРЕК === */
.track-item.is-playing .track-title {
    color: transparent;
    background: linear-gradient(135deg, #6b48ff, #ff2b54);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 5px rgba(255, 43, 84, 0.4));
}
.track-item.is-paused .track-title {
    color: #ff2b54;
}

.track-equalizer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 3px;
    z-index: 5;
}

.track-item.is-playing .track-equalizer,
.track-item.is-paused .track-equalizer {
    display: flex;
}

.eq-bar {
    width: 4px;
    background: #ff2b54;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 43, 84, 0.8);
    animation: eq-bounce 0.8s infinite ease-in-out;
    transform-origin: bottom;
}

.eq-bar:nth-child(1) { height: 12px; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 24px; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 16px; animation-delay: 0.5s; }
.eq-bar:nth-child(4) { height: 20px; animation-delay: 0.2s; }

.track-item.is-paused .eq-bar {
    animation-play-state: paused;
    height: 4px !important;
    animation: none;
    transform: scaleY(1);
}

@keyframes eq-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}
/* ============================================== */

.track-details { flex: 1; min-width: 0; }
.track-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all 0.3s; }
.track-artist { font-size: 13px; color: #8e8e8e; display: flex; align-items: center; gap: 6px; }
.track-plays { font-size: 11px; opacity: 0.7; display: flex; align-items: center; gap: 4px; }

.track-actions { display: flex; gap: 2px; }
.track-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #8e8e8e;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.track-btn:active { background: rgba(128,128,128,0.1); transform: scale(0.9); }
.heart-btn.active { color: #ff2b54 !important; }
.menu-btn { font-size: 18px; }

@media (prefers-color-scheme: dark) {
    .track-btn { color: #a1a1a1; }
    .track-btn:hover { color: #ffffff; }
}

/* === СОСТОЯНИЯ ЗАГРУЗКИ И ПУСТОТЫ === */
.music-loading-spinner { text-align: center; color: var(--text-secondary, #8e8e8e); padding: 40px 0; font-size: 14px; font-weight: 600; }
.music-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 50px 20px; background: rgba(128,128,128,0.02); border-radius: 24px;
    border: 1px dashed rgba(128,128,128,0.2); transition: opacity 0.3s;
}
.music-empty-state.hidden { display: none !important; }
.empty-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%; background: rgba(107, 72, 255, 0.1);
    color: #6b48ff; font-size: 28px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px;
}
.music-empty-state h3 { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
.music-empty-state p { margin: 0 0 20px; font-size: 13px; color: #8e8e8e; line-height: 1.5; max-width: 250px; }
.music-empty-btn {
    background: var(--text-primary, #000); color: var(--bg-panel, #fff); border: none;
    padding: 12px 24px; border-radius: 20px; font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.2s;
}
.music-empty-btn:active { transform: scale(0.95); }

@media (prefers-color-scheme: dark) {
    .music-empty-btn { background: #fff; color: #000; }
}

/* === ЭКРАН ПРОСМОТРА ПЛЕЙЛИСТА (Центрирован) === */
.playlist-view-screen {
    position: fixed; top: 0; left: 50%; width: 100%; max-width: 800px; height: 100dvh;
    background-color: var(--bg-main, #f8f9fa);
    z-index: 1500;
    overflow-y: auto; overflow-x: hidden;
    transform: translate(-50%, 0); opacity: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    display: flex; flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}
@media (prefers-color-scheme: dark) {
    .playlist-view-screen { background-color: #000000; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
}
.playlist-view-screen.hidden { transform: translate(-50%, 100%); opacity: 0; pointer-events: none; }

.pv-header-glass {
    position: sticky; top: 0; left: 0; width: 100%;
    height: calc(60px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
    display: flex; align-items: center; justify-content: space-between;
    padding-left: 15px; padding-right: 15px; box-sizing: border-box;
    background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    z-index: 10; border-bottom: 0.5px solid rgba(0,0,0,0.05);
}
@media (prefers-color-scheme: dark) {
    .pv-header-glass { background: rgba(0, 0, 0, 0.5); border-bottom: 0.5px solid rgba(255,255,255,0.05); }
}
.pv-back-btn, .pv-menu-btn { background: transparent; border: none; font-size: 20px; color: inherit; cursor: pointer; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.pv-back-btn:active, .pv-menu-btn:active { transform: scale(0.8); }
.pv-header-title { font-weight: 700; font-size: 16px; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pv-scroll-container { flex: 1; display: flex; flex-direction: column; }

.pv-hero-section {
    position: relative; padding: 40px 20px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden;
}
.pv-hero-bg {
    position: absolute; top: -20%; left: -20%; width: 140%; height: 140%;
    background-size: cover; background-position: center; filter: blur(60px) opacity(0.4); z-index: 0;
}
.pv-cover {
    width: 220px; height: 220px; border-radius: 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    z-index: 1; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 60px;
    background-size: cover; background-position: center; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.1);
}
.pv-title { font-size: 24px; font-weight: 800; margin: 0 0 8px 0; z-index: 1; position: relative; }
.pv-meta { margin-top: 8px; margin-bottom: 12px; font-size: 13px; color: rgba(255, 255, 255, 0.7); display: flex; align-items: center; justify-content: center; gap: 8px; z-index: 1; position: relative; }
.pv-meta .pv-author { font-weight: 600; color: #fff; }
.pv-dot { opacity: 0.5; font-size: 10px; }
.pv-play-count { display: flex; align-items: center; gap: 4px; }
.pv-desc { font-size: 14px; color: #8e8e8e; margin: 0 0 25px 0; z-index: 1; position: relative; max-width: 80%; line-height: 1.4; }

/* ОБНОВЛЕННЫЙ КОНТЕЙНЕР КНОПОК ПЛЕЙЛИСТА */
.pv-action-buttons { z-index: 1; position: relative; width: 100%; display: flex; justify-content: center; align-items: center; gap: 15px; }

.pv-btn-play {
    background: var(--text-primary, #000); color: var(--bg-panel, #fff); border: none;
    padding: 14px 40px; border-radius: 30px; font-weight: 800; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; gap: 10px; transition: transform 0.2s; box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
@media (prefers-color-scheme: dark) { .pv-btn-play { background: #fff; color: #000; box-shadow: 0 10px 20px rgba(255,255,255,0.15); } }
.pv-btn-play:active { transform: scale(0.95); }

/* НОВЫЕ КРУГЛЫЕ КНОПКИ (Лайк, Репост) */
.pv-circle-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pv-circle-btn:active { transform: scale(0.85); background: rgba(255, 255, 255, 0.3); }
.pv-circle-btn.active { color: #ff2b54; background: #fff; box-shadow: 0 4px 15px rgba(255, 43, 84, 0.3); border-color: transparent; }

/* === СИСТЕМА МОДАЛЬНЫХ ОКОН === */
.brc-music-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 2147483660; display: flex; align-items: center; justify-content: center;
    opacity: 1; transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.brc-music-modal-overlay.hidden { opacity: 0; pointer-events: none; }

.brc-music-modal-card {
    background: var(--bg-panel, #ffffff); width: 92%; max-width: 380px; border-radius: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); border: 1px solid var(--glass-border, rgba(0,0,0,0.05));
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(0) scale(1); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.brc-music-modal-overlay.hidden .brc-music-modal-card { transform: translateY(50px) scale(0.95); }
.brc-music-modal-card.hidden { display: none !important; }

@media (prefers-color-scheme: dark) {
    .brc-music-modal-card { background: #1e1f20; border-color: rgba(255,255,255,0.1); box-shadow: 0 20px 50px rgba(0,0,0,0.6); color: #ffffff; }
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center; padding: 20px 24px;
    border-bottom: 1px solid rgba(128,128,128,0.1); position: relative;
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; text-align: center; }
.modal-close-btn, .modal-back-btn {
    background: rgba(128,128,128,0.1); border: none; color: inherit; width: 32px; height: 32px;
    border-radius: 50%; font-size: 14px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.modal-close-btn:active, .modal-back-btn:active { transform: scale(0.85); }
.modal-back-btn { position: absolute; left: 24px; }
.modal-close-btn { position: absolute; right: 24px; }

@media (prefers-color-scheme: dark) {
    .modal-close-btn, .modal-back-btn { background: rgba(255,255,255,0.1); color: #ffffff; }
}

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.action-choice-grid { display: flex; flex-direction: column; gap: 12px; }
.action-choice-btn {
    background: rgba(128,128,128,0.05); border: 1px solid rgba(128,128,128,0.1); padding: 16px;
    border-radius: 20px; display: flex; align-items: center; gap: 15px; cursor: pointer;
    transition: all 0.2s; color: inherit; font-family: inherit; text-align: left;
}
.action-choice-btn:active { transform: scale(0.96); background: rgba(128,128,128,0.1); }
.choice-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); flex-shrink: 0; }
.choice-text { font-size: 16px; font-weight: 700; }

.drag-drop-zone { border: 2px dashed rgba(128,128,128,0.3); border-radius: 20px; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: all 0.3s; background: rgba(128,128,128,0.02); }
.drag-drop-zone:hover, .drag-drop-zone.dragover { background: rgba(107, 72, 255, 0.05); border-color: #6b48ff; }
.drag-drop-zone.has-file { border-style: solid; border-color: #4ade80; background: rgba(74, 222, 128, 0.05); }
.drop-icon { font-size: 32px; color: #6b48ff; margin-bottom: 12px; transition: transform 0.3s; }
.drag-drop-zone.has-file .drop-icon { color: #4ade80; content: "\f00c"; } 
.drop-text { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.drop-hint { font-size: 12px; color: #8e8e8e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.playlist-cover-upload-area, .track-cover-upload-area { display: flex; justify-content: center; }
.playlist-cover-preview { width: 120px; height: 120px; border-radius: 24px; background: rgba(128,128,128,0.1); border: 1px dashed rgba(128,128,128,0.3); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: #8e8e8e; font-size: 24px; transition: 0.2s; overflow: hidden; position: relative; background-size: cover; background-position: center; }
.playlist-cover-preview:active { transform: scale(0.95); }
.playlist-cover-preview span { font-size: 11px; font-weight: 600; margin-top: 8px; }
.playlist-cover-preview.has-image { border-style: solid; border-color: transparent; }
.playlist-cover-preview.has-image i, .playlist-cover-preview.has-image span { opacity: 0; }

.music-input-group { display: flex; flex-direction: column; gap: 6px; }
.music-input-group label { font-size: 12px; font-weight: 600; color: #8e8e8e; margin-left: 4px; }
.music-glass-input { background: rgba(128,128,128,0.05); border: 1px solid rgba(128,128,128,0.1); color: inherit; padding: 14px 16px; border-radius: 16px; font-size: 14px; font-family: inherit; font-weight: 500; transition: all 0.3s; outline: none; box-sizing: border-box; width: 100%; }
.music-glass-input:focus { border-color: #ff2b54; background: rgba(128,128,128,0.08); box-shadow: 0 0 0 3px rgba(255, 43, 84, 0.1); }
@media (prefers-color-scheme: dark) { .music-glass-input { color: #ffffff; } }

.music-submit-btn { background: linear-gradient(135deg, #6b48ff, #ff2b54); color: #fff; border: none; padding: 16px; border-radius: 16px; font-weight: 800; font-size: 15px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 15px rgba(107, 72, 255, 0.3); margin-top: 10px; }
.music-submit-btn:active { transform: scale(0.96); }
.music-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.upload-progress-container { display: flex; flex-direction: column; gap: 8px; margin-top: -10px; }
.upload-progress-container.hidden { display: none; }
.upload-progress-bar { width: 100%; height: 6px; background: rgba(128,128,128,0.1); border-radius: 3px; overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6b48ff, #ff2b54); transition: width 0.3s; }
.upload-progress-text { font-size: 11px; font-weight: 600; color: #8e8e8e; text-align: center; }

/* === КОНТЕКСТНОЕ МЕНЮ === */
.track-context-menu { position: fixed; background: rgba(30, 30, 35, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; z-index: 3000; box-shadow: 0 10px 40px rgba(0,0,0,0.5); width: 220px; overflow: hidden; transform-origin: top right; animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); color: #ffffff; }
.track-context-menu.hidden { display: none; }
@media (prefers-color-scheme: light) { .track-context-menu { background: rgba(255, 255, 255, 0.95); box-shadow: 0 10px 40px rgba(0,0,0,0.15); border-color: rgba(0,0,0,0.05); color: #000000; } }

.tcm-header { padding: 12px 15px; font-weight: 800; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; color: inherit; }
@media (prefers-color-scheme: light) { .tcm-header { border-bottom: 1px solid rgba(0,0,0,0.05); } }

.tcm-item { padding: 12px 15px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; gap: 10px; color: inherit; }
.tcm-item:hover, .tcm-item:active { background: rgba(255,255,255,0.1); }
@media (prefers-color-scheme: light) { .tcm-item:hover, .tcm-item:active { background: rgba(0,0,0,0.05); } }

.tcm-item.danger { color: #ff4757; }
.tcm-item.danger i { color: #ff4757; }
.tcm-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }
@media (prefers-color-scheme: light) { .tcm-divider { background: rgba(0,0,0,0.05); } }

.tcm-section-title { font-size: 11px; color: #8e8e8e; padding: 6px 15px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }


/* ========================================================================= */
/* === ГЛОБАЛЬНЫЙ ПЛЕЕР (ОСТРОВ / FULLSCREEN / КАРАОКЕ) === */
/* ========================================================================= */

.brc-player-island {
    position: fixed; bottom: calc(75px + env(safe-area-inset-bottom)); left: 50%; width: calc(100% - 20px); max-width: 780px;
    transform: translateX(-50%) translateY(0);
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px; padding: 12px 15px; z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
    border: 0.5px solid rgba(255,255,255,0.4);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    overflow: hidden; display: flex; flex-direction: column;
}

@media (prefers-color-scheme: dark) {
    .brc-player-island { background: rgba(30, 30, 35, 0.85); box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05); border: 0.5px solid rgba(255,255,255,0.08); }
}

.brc-player-island.hidden-player { transform: translateX(-50%) translateY(calc(100% + 150px)); pointer-events: none; }

/* ФУЛЛСКРИН РЕЖИМ (Центрирован) */
.brc-player-island.fullscreen {
    bottom: 0; left: 50%; top: 0; width: 100%; max-width: 800px; transform: translateX(-50%); border-radius: 0;
    /* Учитываем safe-area-inset-bottom чтобы комментарии не проваливались */
    padding: calc(30px + env(safe-area-inset-top)) 20px calc(25px + env(safe-area-inset-bottom));
    background: rgba(248, 249, 250, 0.98); border: none;
    z-index: 2147483630;
}
@media (prefers-color-scheme: dark) { .brc-player-island.fullscreen { background: rgba(10, 10, 12, 0.98); } }

.player-close-fullscreen-btn {
    display: none; position: absolute; top: calc(15px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    background: rgba(128,128,128,0.2); border: none; width: 40px; height: 6px; border-radius: 3px; cursor: pointer; z-index: 10;
}
@media (prefers-color-scheme: dark) { .player-close-fullscreen-btn { background: rgba(255, 255, 255, 0.4); } }
.brc-player-island.fullscreen .player-close-fullscreen-btn { display: block; }

/* ОСНОВНОЙ ЛАЙАУТ И ОБЛОЖКА */
.player-core-layout { display: flex; align-items: center; gap: 12px; cursor: pointer; width: 100%; transition: all 0.4s ease; position: relative; }
.player-cover-wrap { position: relative; width: 44px; height: 44px; flex-shrink: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1); }
.player-cover { width: 100%; height: 100%; border-radius: 12px; background: #111; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; z-index: 2; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.player-cover-ring { position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; border-radius: 15px; background: linear-gradient(135deg, #6b48ff, #ff2b54); z-index: 1; opacity: 0.5; filter: blur(6px); transition: all 0.4s; }

.player-track-info { flex: 1; min-width: 0; transition: all 0.4s; z-index: 5; }
.player-title { font-size: 14px; font-weight: 800; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all 0.4s; }
.player-artist { font-size: 12px; color: #8e8e8e; transition: all 0.4s; }

/* КНОПКИ УПРАВЛЕНИЯ ПЛЕЕРОМ (Play, Next, Prev) */
.player-controls { display: flex; align-items: center; gap: 8px; transition: all 0.4s; z-index: 5;}
.ctrl-btn { background: transparent; border: none; color: inherit; font-size: 16px; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s; }
.ctrl-btn:active { background: rgba(128,128,128,0.1); transform: scale(0.9); }
.play-pause-btn { background: var(--text-primary, #000); color: var(--bg-panel, #fff) !important; font-size: 14px; }
@media (prefers-color-scheme: dark) { .play-pause-btn { background: #ffffff; color: #000000 !important; } }

/* === FULLSCREEN ТРАНСФОРМАЦИЯ === */
.brc-player-island.fullscreen .player-core-layout { flex-direction: column; text-align: center; cursor: default; margin-top: 4vh; gap: 20px; }
.brc-player-island.fullscreen .player-cover-wrap { width: 75vw; max-width: 340px; height: 75vw; max-height: 340px; margin: 0 auto; }
.brc-player-island.fullscreen .player-cover { border-radius: 30px; font-size: 60px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.brc-player-island.fullscreen .player-cover-ring { border-radius: 35px; opacity: 0.7; filter: blur(15px); top: -8px; left: -8px; right: -8px; bottom: -8px; }

.brc-player-island.fullscreen .player-track-info { margin-bottom: 5px; margin-top: 10px; width: 100%; }
.brc-player-island.fullscreen .player-title { font-size: 26px; margin-bottom: 6px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brc-player-island.fullscreen .player-artist { font-size: 16px; }

.brc-player-island.fullscreen .player-controls { justify-content: center; gap: 25px; width: 100%; margin-bottom: 10px; }
.brc-player-island.fullscreen .player-controls .ctrl-btn { width: 50px; height: 50px; font-size: 24px; }
.brc-player-island.fullscreen .player-controls .play-pause-btn { width: 75px; height: 75px; font-size: 28px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.brc-player-island.fullscreen .close-mini-btn { display: none; }

/* === БЛОК ДЕЙСТВИЙ: ЛАЙК, ТЕКСТ, ПОДЕЛИТЬСЯ (Только Fullscreen) === */
.player-actions-row { display: none; }
.brc-player-island.fullscreen .player-actions-row {
    display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; margin-bottom: 15px; z-index: 5;
}
.brc-player-island.fullscreen .player-actions-row .action-btn {
    background: rgba(128,128,128,0.08); border-radius: 20px; padding: 10px 20px; font-size: 18px; color: var(--text-primary, #000);
    display: flex; align-items: center; justify-content: center; width: auto; height: 44px; border: none; cursor: pointer; transition: 0.2s;
}
@media (prefers-color-scheme: dark) {
    .brc-player-island.fullscreen .player-actions-row .action-btn { color: #fff; background: rgba(255,255,255,0.08); }
}
.brc-player-island.fullscreen .player-actions-row .action-btn:active { transform: scale(0.92); }
.brc-player-island.fullscreen .player-actions-row .heart-btn.active { color: #ff2b54; background: rgba(255, 43, 84, 0.15); }
.brc-player-island.fullscreen .player-actions-row .lyrics-btn.active { color: #6b48ff; background: rgba(107, 72, 255, 0.15); }


/* === КАРАОКЕ ПАНЕЛЬ (ЗАМЕНЯЕТ ОБЛОЖКУ) === */
.player-lyrics-panel { display: none; }
.brc-player-island.fullscreen .player-lyrics-panel:not(.hidden) {
    display: flex;
    width: 80vw; max-width: 360px;
    height: 75vw; max-height: 340px;
    margin: 0 auto;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    z-index: 10;
}

.player-lyrics-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    -ms-overflow-style: none; scrollbar-width: none;
}
.player-lyrics-container::-webkit-scrollbar { display: none; }

.lyric-line {
    font-size: 22px;
    font-weight: 800;
    color: rgba(128, 128, 128, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    line-height: 1.3;
}
.lyric-line:hover { color: rgba(128, 128, 128, 0.8); }

.lyric-line.active {
    font-size: 28px;
    transform: scale(1.05);
    background: linear-gradient(135deg, #6b48ff, #ff2b54);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(255, 43, 84, 0.4));
}

@media (prefers-color-scheme: dark) {
    .lyric-line { color: rgba(255, 255, 255, 0.3); }
    .lyric-line:hover { color: rgba(255, 255, 255, 0.6); }
    .lyric-line.active {
        filter: drop-shadow(0 0 20px rgba(107, 72, 255, 0.6));
    }
}

.player-core-layout:has(.player-lyrics-panel:not(.hidden)) .player-cover-wrap {
    display: none;
}


/* === ТАЙМЛАЙН, МИНИ-ПРОГРЕСС И НИЖНЯЯ ПАНЕЛЬ С КОММЕНТАРИЯМИ === */
.mini-progress-track { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: rgba(128,128,128,0.1); }
.mini-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6b48ff, #ff2b54); transition: width 0.1s linear; }
.brc-player-island.fullscreen .mini-progress-track { display: none; }

.player-fullscreen-exclusive { display: none; opacity: 0; flex-direction: column; width: 100%; margin-top: auto; position: relative; }
.brc-player-island.fullscreen .player-fullscreen-exclusive { display: flex; opacity: 1; animation: fadeIn 0.6s ease forwards 0.2s; }

.player-timeline-container { display: flex; align-items: center; gap: 15px; margin-top: 10px; width: 100%; }
.time-text { font-size: 12px; font-weight: 600; color: #8e8e8e; min-width: 40px; text-align: center; }
.player-progress-area { flex: 1; height: 40px; position: relative; cursor: pointer; display: flex; align-items: center; }
.progress-bg { width: 100%; height: 6px; background: rgba(128,128,128,0.1); border-radius: 3px; }
.progress-bar { position: absolute; left: 0; top: 17px; height: 6px; width: 0%; background: linear-gradient(90deg, #6b48ff, #ff2b54); border-radius: 3px; z-index: 2; pointer-events: none;}
.progress-head { position: absolute; top: 11px; left: 0%; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.3); z-index: 3; transform: translateX(-50%); pointer-events: none; }

.player-comments-track { position: absolute; top: -5px; left: 0; width: 100%; height: 100%; pointer-events: none; }
.timeline-avatar { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bg-main, #fff); box-shadow: 0 2px 8px rgba(0,0,0,0.3); transform: translateX(-50%); transition: transform 0.2s, z-index 0.2s; pointer-events: auto; cursor: pointer;}
.timeline-avatar:hover { transform: translateX(-50%) scale(1.5); z-index: 100; }
@media (prefers-color-scheme: dark) { .timeline-avatar { border-color: #000; } }

/* Поле ввода комментария */
.player-bottom-row { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 20px; width: 100%; }
.player-bottom-row .player-comment-input-wrap { width: 100%; }

/* === ШТОРКА КОММЕНТАРИЕВ BOTTOM SHEET (Центрирована) === */
.comments-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0,0,0,0.5); z-index: 2147483660; opacity: 1; transition: opacity 0.3s; }
.comments-overlay.hidden { opacity: 0; pointer-events: none; }
.comments-bottom-sheet { position: fixed; bottom: 0; left: 50%; width: 100%; max-width: 800px; height: 75dvh; background: var(--bg-panel, #ffffff); border-radius: 30px 30px 0 0; z-index: 2147483665; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); transform: translate(-50%, 0); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1); }
@media (prefers-color-scheme: dark) { .comments-bottom-sheet { background: #1e1f20; } }
.comments-bottom-sheet.hidden { transform: translate(-50%, 100%); }
.comments-sheet-handle { width: 40px; height: 5px; background: rgba(128,128,128,0.3); border-radius: 3px; margin: 12px auto; cursor: grab; flex-shrink: 0; }
.comments-sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 15px; border-bottom: 1px solid rgba(128,128,128,0.1); flex-shrink: 0; }
.comments-sheet-header h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; }
.close-sheet-btn { background: rgba(128,128,128,0.1); border: none; width: 30px; height: 30px; border-radius: 50%; color: inherit; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.close-sheet-btn:active { transform: scale(0.85); }
.comments-sheet-body { flex: 1; overflow-y: auto; padding: 10px 20px; display: flex; flex-direction: column; gap: 15px; }
.comment-item { display: flex; gap: 12px; animation: popIn 0.3s ease; }
.comment-item.is-reply { margin-left: 40px; position: relative; }
.comment-item.is-reply::before { content: ''; position: absolute; left: -25px; top: -10px; width: 15px; height: 25px; border-left: 2px solid rgba(128,128,128,0.2); border-bottom: 2px solid rgba(128,128,128,0.2); border-bottom-left-radius: 10px; }
.c-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.c-content { flex: 1; }
.c-name { font-size: 13px; font-weight: 700; color: #8e8e8e; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.c-time-badge { background: rgba(107, 72, 255, 0.1); color: #6b48ff; padding: 2px 6px; border-radius: 8px; font-size: 10px; font-weight: 800; cursor: pointer; }
.c-text { font-size: 14px; line-height: 1.4; margin-bottom: 6px; }
.c-actions { display: flex; gap: 15px; font-size: 12px; color: #8e8e8e; font-weight: 600; }
.c-action-btn { background: transparent; border: none; color: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 5px; }
.c-action-btn:active { opacity: 0.7; }
.c-like-btn.active { color: #ff2b54; }
.comments-sheet-footer { padding: 15px 20px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(128,128,128,0.1); background: var(--bg-panel, #ffffff); flex-shrink: 0; }
@media (prefers-color-scheme: dark) { .comments-sheet-footer { background: #1e1f20; } }
.reply-indicator { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8e8e8e; margin-bottom: 10px; padding: 8px 12px; background: rgba(128,128,128,0.1); border-radius: 10px; }
.reply-indicator.hidden { display: none; }
.cancel-reply-btn { background: transparent; border: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0; }
.player-comment-input-wrap { flex: 1; height: 44px; background: rgba(128,128,128,0.08); border-radius: 22px; display: flex; align-items: center; padding: 0 5px 0 12px; gap: 10px; }
.comment-avatar-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.player-comment-input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; color: inherit; font-family: inherit; }
@media (prefers-color-scheme: dark) { .player-comment-input { color: #ffffff; } }
.comment-send-btn { width: 34px; height: 34px; border-radius: 50%; background: #ff2b54; color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.comment-send-btn:active { transform: scale(0.9); }

/* === ВСПЛЫВАЮЩИЕ ОБЛАЧКА КОММЕНТАРИЕВ === */
.music-toast-container { position: fixed; bottom: calc(100px + env(safe-area-inset-bottom)); left: 0; width: 100%; pointer-events: none; z-index: 2500; display: flex; justify-content: center; align-items: flex-end; }
.brc-player-island.fullscreen ~ .music-toast-container { bottom: calc(260px + env(safe-area-inset-bottom)); }
.player-cloud-toast { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 15px 35px rgba(0,0,0,0.15); border-radius: 24px; padding: 10px 16px 10px 10px; display: flex; align-items: center; gap: 12px; max-width: 85%; pointer-events: auto; cursor: pointer; position: relative; opacity: 0; transform: translateY(20px) scale(0.9); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@media (prefers-color-scheme: dark) { .player-cloud-toast { background: rgba(30, 30, 35, 0.85); border-color: rgba(255, 255, 255, 0.1); box-shadow: 0 15px 35px rgba(0,0,0,0.5); } }
.player-cloud-toast::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid rgba(255, 255, 255, 0.8); backdrop-filter: blur(25px); }
@media (prefers-color-scheme: dark) { .player-cloud-toast::after { border-top-color: rgba(30, 30, 35, 0.85); } }
.player-cloud-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.cloud-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.cloud-content { display: flex; flex-direction: column; justify-content: center; }
.cloud-name { font-size: 11px; font-weight: 800; color: #ff2b54; margin-bottom: 2px; }
.cloud-text { font-size: 13px; font-weight: 600; color: var(--text-primary, #000); line-height: 1.2; }
@media (prefers-color-scheme: dark) { .cloud-text { color: #fff; } }