/* ==========================================================
   1. ПЕРЕМЕННЫЕ И БАЗА
   ========================================================== */
:root {
    --bg-color: #05040a;
    --surface-color: rgba(20, 15, 35, 0.6);
    --surface-hover: rgba(35, 25, 60, 0.8);
    --primary: #a78bfa;
    --primary-hover: #c084fc;
    --secondary: #67e8f9;
    --text-main: #ffffff;
    --text-muted: #8a8a9d;
    --glass-border: rgba(138, 43, 226, 0.25);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
}

/* Космический фон */
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(circle at 15% 25%, rgba(138, 43, 226, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(255, 219, 77, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 45% 85%, rgba(0, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 65% 15%, rgba(167, 139, 250, 0.1) 0%, transparent 35%);
    pointer-events: none; 
    z-index: 0;
}
body::after {
    content: '';
    position: fixed; inset: 0;
    background-image:
        radial-gradient(2px 2px at 10% 20%, #fff, transparent),
        radial-gradient(1px 1px at 25% 35%, #fff, transparent),
        radial-gradient(2px 2px at 40% 15%, #fff, transparent),
        radial-gradient(1px 1px at 55% 45%, #fff, transparent),
        radial-gradient(3px 3px at 70% 25%, #fff, transparent);
    background-size: 300px 300px;
    opacity: 0.5; 
    animation: twinkle 4s infinite alternate; 
    pointer-events: none; 
    z-index: 0;
}
@keyframes twinkle { 0% { opacity: .2; } 100% { opacity: .6; } }

.hidden { display: none !important; }
.mobile-only { display: none !important; }

/* Общий скроллбар */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(138, 43, 226, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==========================================================
   2. ОСНОВНОЙ LAYOUT
   ========================================================== */
#app-container {
    height: 100vh; display: flex; flex-direction: column;
    position: relative; z-index: 1;
}

/* --- Шапка --- */
header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; height: 70px;
    background: rgba(12,8,25,.8); backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}
.logo-link { text-decoration: none; display: inline-block; transition: opacity .2s; }
.logo-link:hover { opacity: 0.8; }
.logo {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, #ffdb4d, #c084fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    padding-bottom: 2px;
}

.header-center { display: flex; align-items: center; flex: 1; justify-content: center; gap: 20px; }

.search-container {
    display: flex; align-items: center;
    background: rgba(30,20,50,.6); border-radius: 40px; padding: 6px 16px;
    width: 300px; border: 1px solid rgba(255, 255, 255, 0.1);
}
#search-input { background: transparent; border: none; color: #fff; padding: 6px 0; width: 100%; outline: none; font-size: 14px; }
#search-input::placeholder { color: var(--text-muted); }

/* Трек дня */
.daily-track-header {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 16px; border-radius: 40px;
    background: rgba(138,43,226,.1); border: 1px solid rgba(138,43,226,.25);
    cursor: pointer; transition: .2s; height: 40px;
}
.daily-track-header:hover { background: rgba(138,43,226,.2); }
.daily-track-icon-wrapper { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.daily-track-icon { font-size: 16px; }
.daily-track-icon-label { font-size: 8px; color: var(--primary); font-weight: 700; margin-top: 2px; }
.daily-track-text { font-size: 13px; color: #fff; font-weight: 500; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c0c0e0; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: .2s;
}
.icon-btn:hover { background: var(--surface-hover); color: #fff; border-color: var(--primary); }

.app-layout { display: flex; flex: 1; overflow: hidden; }

/* ==========================================================
   3. САЙДБАР
   ========================================================== */
.sidebar {
    width: 130px; flex-shrink: 0;
    background: rgba(5, 4, 10, 0.4); backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; flex-direction: column; padding: 20px 12px;
}

.sidebar-nav-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; width: 100%; padding: 12px 8px; margin-bottom: 8px;
    background: transparent; border: none; border-radius: 12px;
    color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: .2s;
}
.sidebar-nav-btn .sidebar-icon { font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* Звездочки */
.sidebar-nav-btn .icon-outline { display: inline-block; }
.sidebar-nav-btn .icon-filled { display: none; }
.sidebar-nav-btn.active .icon-outline { display: none; }
.sidebar-nav-btn.active .icon-filled { display: inline-block; color: var(--primary); }

.sidebar-nav-btn:hover { background: rgba(138, 43, 226, 0.1); color: #fff; }
.sidebar-nav-btn.active { background: rgba(138,43,226,0.2); color: var(--primary); }

.sidebar-divider { height: 1px; background: rgba(255, 255, 255, 0.05); margin: 12px 0; }

/* Карточка плейлиста */
.sidebar-playlist-item {
    position: relative; display: flex; flex-direction: column; align-items: center; 
    padding: 6px; border-radius: 12px; cursor: pointer; 
    transition: .2s; color: var(--text-muted); text-align: center;
}
.sidebar-playlist-item:hover { background: rgba(255,255,255,0.05); color: #fff; }

.sidebar-playlist-cover {
    width: 64px; height: 64px; border-radius: 8px;
    background: linear-gradient(135deg, #2a1a4a, #1a0a2a);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: 8px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}
.sidebar-playlist-cover img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-playlist-name {
    font-size: 12px; font-weight: 500; line-height: 1.2;
    word-break: break-word; width: 100%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.playlist-more-btn {
    position: absolute; top: 10px; right: 10px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    border: none; color: #fff; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: .2s; z-index: 5;
}
.sidebar-playlist-item:hover .playlist-more-btn { opacity: 1; }
.playlist-more-btn:hover { background: var(--primary); transform: scale(1.1); }

.sidebar-create-playlist-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px; margin-top: 16px;
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px; 
    color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s;
}
.sidebar-create-playlist-btn:hover { 
    background: rgba(138,43,226,.15); border-color: rgba(138,43,226,.4); 
    color: var(--primary); transform: translateY(-2px);
}

/* ==========================================================
   4. КОНТЕНТ И КАРТОЧКИ
   ========================================================== */
.main-content {
    flex: 1; overflow-y: auto;
    padding: 32px 48px 140px 48px;
}

.track-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px;
}
.track-card {
    position: relative; background: var(--surface-color); backdrop-filter: blur(20px);
    border-radius: 16px; padding: 16px; cursor: pointer; transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.track-card:hover {
    background: var(--surface-hover); border-color: rgba(167,139,250,0.4);
    box-shadow: 0 12px 25px rgba(0,0,0,0.4), 0 0 20px rgba(138,43,226,0.15);
    transform: translateY(-5px);
}
.track-card-cover {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4); transition: transform 0.3s ease;
}
.track-card:hover .track-card-cover { transform: scale(1.02); }
.track-card-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.track-card-artist { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-card.playing { border: 2px solid var(--primary); background: rgba(40,30,65,0.9); }
.track-card.playing .track-card-title { color: var(--primary-hover); }

.track-menu-container { position: absolute; top: 12px; right: 12px; z-index: 10; }
.track-menu-btn {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.1); color: #fff; 
    font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; 
    opacity: 0; transition: all 0.2s ease;
}
.track-card:hover .track-menu-btn { opacity: 0.9; }
.track-menu-btn:hover { background: var(--primary); }

.swipe-indicator { display: none; } /* Скрыто на ПК */

/* ==========================================================
   5. ПАРЯЩИЙ НИЖНИЙ ПЛЕЕР
   ========================================================== */
.bottom-player {
    position: fixed; bottom: 20px; left: 140px; right: 20px; height: 80px;
    background: rgba(18, 12, 35, 0.9); backdrop-filter: blur(30px);
    border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; z-index: 50;
}

.custom-player { width: 100%; display: flex; align-items: center; padding: 0 20px; gap: 16px; }

.player-track-info { display: flex; align-items: center; gap: 12px; width: 280px; flex-shrink: 0; }
.player-cover-small {
    width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.player-cover-small img { width: 100%; height: 100%; object-fit: cover; }
.player-track-details { flex: 1; min-width: 0; }
.player-track-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track-artist { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Кнопки управления */
.player-action-btn, .player-menu-btn {
    background: transparent; border: none; color: var(--text-muted); cursor: pointer;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: .2s; flex-shrink: 0; font-size: 16px;
}
.player-action-btn:hover, .player-menu-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.player-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-shrink: 0; }
.player-btn { background: transparent; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .2s; }
.player-btn:hover { color: #fff; }
.player-btn.play-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6b21a8); color: #fff; font-size: 18px;
    box-shadow: 0 4px 15px rgba(139,92,246,0.4);
}
.player-btn.play-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(167,139,250,0.6); }

.progress-container { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 150px; }
.time-current, .time-duration { font-size: 11px; color: var(--text-muted); font-weight: 500; min-width: 30px; text-align: center; }
.progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; cursor: pointer; position: relative; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--secondary), var(--primary)); border-radius: 2px;
    box-shadow: 0 0 10px var(--secondary); position: relative; width: 0%; transition: width 0.1s linear;
}
.progress-fill::after {
    content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) scale(0);
    width: 12px; height: 12px; background: #fff; border-radius: 50%; box-shadow: 0 0 10px var(--primary); transition: transform 0.2s;
}
.progress-bar:hover .progress-fill::after { transform: translateY(-50%) scale(1); }

.volume-container { display: flex; align-items: center; gap: 8px; width: 100px; flex-shrink: 0; margin-left: 10px; }
.volume-icon { color: var(--text-muted); cursor: pointer; font-size: 16px; }
.volume-slider { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; cursor: pointer; position: relative; }
.volume-fill { height: 100%; background: #fff; border-radius: 2px; width: 70%; transition: width 0.1s; }
.volume-fill::after {
    content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) scale(0);
    width: 10px; height: 10px; background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.volume-slider:hover .volume-fill::after { transform: translateY(-50%) scale(1); }

/* ==========================================================
   6. МОЯ ВОЛНА
   ========================================================== */
.wave-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; width: 100%; text-align: center; position: relative;
}

/* Светящееся пятно */
.wave-screen::before {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 500px; height: 500px; background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
    filter: blur(60px); z-index: 0; pointer-events: none;
    animation: pulseGlow 6s ease-in-out infinite alternate;
}
@keyframes pulseGlow { 0% { transform: translate(-50%, -50%) scale(1); } 100% { transform: translate(-50%, -50%) scale(1.2); } }

.wave-header { margin-bottom: 40px; z-index: 1; }
.wave-header h2 {
    font-size: 54px; font-weight: 900;
    background: linear-gradient(135deg, #e879f9, #67e8f9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -1px; margin-bottom: 12px;
}
.wave-header p { color: var(--text-muted); font-size: 18px; }

.wave-play-btn {
    padding: 18px 50px; background: linear-gradient(135deg, var(--primary), #6b21a8);
    border: none; color: #fff; border-radius: 50px; font-size: 20px; font-weight: 800;
    cursor: pointer; box-shadow: 0 10px 40px rgba(139,92,246,0.5); transition: all 0.3s ease; z-index: 2;
    display: flex; align-items: center; gap: 12px;
}
.wave-play-btn:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(167,139,250,0.7); }
.wave-play-btn.playing { background: transparent; color: var(--primary); }

/* Визуализатор */
.wave-visualizer-wrapper {
    position: relative; display: flex; flex-direction: column;
    margin-top: 50px; z-index: 1;
}
.wave-bars, .wave-reflection { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 60px; }
.wave-bar, .wave-bar-ref {
    width: 6px; height: 8px; border-radius: 10px; 
    background: linear-gradient(to top, #8b5cf6, #22d3ee); 
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}
.wave-reflection { 
    margin-top: -2px; align-items: flex-start; opacity: 0.6; filter: blur(1px);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}
.wave-brand-text { 
    font-size: 12px; letter-spacing: 8px; color: rgba(160, 160, 192, 0.6); 
    text-transform: uppercase; margin-top: -45px; padding-left: 5px;
}

/* ==========================================================
   7. ОБЩИЕ СТИЛИ МОДАЛОК И МЕНЮ
   ========================================================== */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: rgba(18,12,35,.95); backdrop-filter: blur(20px); padding: 24px; border-radius: 20px;
    width: 400px; max-width: 90%; border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,.6);
}
.modal-content h3 { margin-bottom: 20px; color: var(--primary); }
.modal-content input {
    width: 100%; padding: 14px; margin-bottom: 12px; background: rgba(30,20,50,.8);
    border: 1px solid rgba(138,43,226,.3); color: #fff; border-radius: 12px; outline: none;
    font-family: inherit;
}
.modal-content input::placeholder { color: rgba(160, 160, 192, 0.5); }

/* Общие кнопки в модалках */
.modal-buttons { display: flex; gap: 12px; margin-top: 20px; }
.modal-buttons button {
    flex: 1; padding: 14px 20px; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: all 0.2s ease; outline: none;
}
.modal-buttons button.primary-btn,
.modal-buttons button:first-child {
    background: linear-gradient(135deg, var(--primary), #6b21a8); color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.modal-buttons button.primary-btn:hover,
.modal-buttons button:first-child:hover {
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}
.modal-buttons button.secondary-btn,
.modal-buttons button:last-child {
    background: rgba(255, 255, 255, 0.05); color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-buttons button.secondary-btn:hover,
.modal-buttons button:last-child:hover {
    background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.2);
}

/* Общие выпадающие меню */
.dropdown-menu, .player-dropdown, .track-dropdown, .playlist-context-menu {
    position: fixed; background: rgba(18,12,35,.98); backdrop-filter: blur(20px);
    border-radius: 16px; border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 200px; z-index: 9999; padding: 8px;
    display: flex; flex-direction: column;
}
.dropdown-item, .context-menu-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px;
    background: transparent; border: none; color: #c0c0e0; font-size: 14px; text-align: left;
    border-radius: 10px; cursor: pointer; transition: .15s; font-family: inherit;
}
.dropdown-item:hover, .context-menu-item:hover { background: rgba(138,43,226,.2); color: #fff; }
.dropdown-item.danger, .context-menu-item.danger { color: #ff6b6b; }
.dropdown-item.danger:hover, .context-menu-item.danger:hover { background: rgba(255,107,107,.15); color: #ff6b6b; }
.dropdown-item span, .context-menu-item span { font-size: 18px; width: 24px; text-align: center; }

/* Меню профиля */
#user-dropdown-menu { top: 60px; right: 20px; position: absolute; }
#menu-user-email {
    padding: 12px 16px; color: #c084fc; font-size: 13px; font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); margin-bottom: 8px; word-break: break-all;
}
.dropdown-divider { border: none; height: 1px; background: rgba(255, 255, 255, 0.05); margin: 8px 0; width: 100%; }

/* ==========================================================
   8. СПЕЦИФИЧНЫЕ МОДАЛКИ
   ========================================================== */

/* --- История --- */
.history-modal-content { max-width: 550px; width: 90%; max-height: 85vh; display: flex; flex-direction: column; }
.history-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.close-btn { background: transparent; border: none; color: #a0a0c0; font-size: 20px; cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: #fff; transform: scale(1.1); }

.history-list-container { overflow-y: auto; flex: 1; padding-right: 8px; }
.history-group-title { font-size: 12px; color: #a78bfa; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin: 16px 0 8px 4px; }

.history-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: rgba(30, 20, 50, 0.4); border-radius: 12px; margin-bottom: 6px;
    border: 1px solid transparent; transition: all 0.2s ease; cursor: pointer;
}
.history-item:hover { background: rgba(40, 30, 65, 0.8); border-color: rgba(167, 139, 250, 0.3); transform: translateX(4px); }
.history-item-icon {
    width: 40px; height: 40px; background: linear-gradient(135deg, #2a1a4a, #1a0a2a);
    border-radius: 8px; display: flex; justify-content: center; align-items: center;
    font-size: 18px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.05);
}
.history-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.history-item-title { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.history-item-artist { color: #a0a0c0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-time { font-size: 12px; color: #888; font-family: monospace; flex-shrink: 0; margin-right: 8px; }

.history-item-actions { display: flex; gap: 6px; flex-shrink: 0; opacity: 0; transition: opacity 0.2s ease; }
.history-item:hover .history-item-actions { opacity: 1; }
.history-action-btn {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.05);
    border: none; color: #c0c0e0; cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: 0.2s; font-size: 14px;
}
.history-action-btn:hover { background: #a78bfa; color: #fff; transform: scale(1.1); }

.history-empty { text-align: center; padding: 40px 20px; color: #a0a0c0; }
.history-empty span { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.5; }

.history-modal-footer { display: flex; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.history-modal-footer button { flex: 1; padding: 14px; border-radius: 12px; border: none; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: 0.2s; }
#clear-history-btn { background: rgba(255, 107, 107, 0.1); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.2); }
#clear-history-btn:hover { background: rgba(255, 107, 107, 0.2); border-color: #ff6b6b; transform: translateY(-2px); }
#close-history-footer { background: rgba(138, 43, 226, 0.15); color: #c084fc; border: 1px solid rgba(138, 43, 226, 0.3); }
#close-history-footer:hover { background: rgba(138, 43, 226, 0.3); border-color: #a78bfa; transform: translateY(-2px); }

/* --- Настройки --- */
.settings-modal-content { max-width: 480px; width: 95%; }
.settings-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.settings-modal-header h3 { color: #c084fc; font-size: 22px; margin: 0; }
#close-settings-modal { background: rgba(255, 255, 255, 0.05); border: none; color: #a0a0c0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; transition: 0.2s; }
#close-settings-modal:hover { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }

.settings-section { margin-bottom: 24px; }
.settings-section h4 { color: #a0a0c0; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; padding-left: 4px; }
.settings-item { display: flex; justify-content: space-between; align-items: center; background: rgba(30, 20, 50, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 16px; }
.settings-item-info { display: flex; align-items: center; gap: 16px; }
.settings-icon { width: 40px; height: 40px; background: rgba(138, 43, 226, 0.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.settings-title { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.settings-desc { color: #888; font-size: 12px; }

.theme-toggle-btn { background: rgba(138, 43, 226, 0.15); border: 1px solid rgba(138, 43, 226, 0.3); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.theme-toggle-btn:hover { background: rgba(138, 43, 226, 0.3); transform: scale(1.05); }

.settings-item-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; background: rgba(30, 20, 50, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 16px; text-align: left; cursor: pointer; transition: 0.2s; font-family: inherit; }
.settings-item-btn:hover { background: rgba(40, 30, 65, 0.8); border-color: rgba(167, 139, 250, 0.4); }
.settings-item-arrow { color: #a0a0c0; font-size: 20px; transition: 0.2s; }
.settings-item-btn:hover .settings-item-arrow { color: #c084fc; transform: translateX(4px); }

.settings-modal-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
#close-settings-footer { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), #6b21a8); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s; }
#close-settings-footer:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

/* --- Горячие клавиши --- */
.hotkeys-modal-content { max-width: 500px; width: 95%; display: flex; flex-direction: column; }
.hotkeys-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.hotkeys-modal-header h3 { color: #c084fc; font-size: 22px; margin: 0; }
#close-hotkeys-modal { background: rgba(255, 255, 255, 0.05); border: none; color: #a0a0c0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
#close-hotkeys-modal:hover { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }

.hotkeys-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; padding-right: 8px; margin-bottom: 16px; }
.hotkey-row { display: flex; justify-content: space-between; align-items: center; background: rgba(30, 20, 50, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: #c0c0e0; transition: 0.2s; }
.hotkey-row:hover { background: rgba(40, 30, 65, 0.8); border-color: rgba(167, 139, 250, 0.3); }
.hotkey-keys { display: flex; gap: 6px; }
.hotkey-keys kbd { display: inline-block; min-width: 32px; padding: 4px 10px; background: rgba(138, 43, 226, 0.15); border: 1px solid rgba(138, 43, 226, 0.4); border-bottom-width: 3px; border-radius: 6px; font-family: monospace; font-size: 12px; font-weight: 700; color: #c084fc; text-align: center; cursor: pointer; transition: 0.1s; box-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.hotkey-keys kbd:hover { background: rgba(138, 43, 226, 0.3); border-color: #a78bfa; transform: translateY(-1px); }
.hotkey-keys kbd:active { transform: translateY(2px); border-bottom-width: 1px; }
.hotkey-keys kbd.listening { background: rgba(255, 179, 71, 0.2); border-color: #ffb347; color: #ffb347; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.5; } }

.hotkeys-hint { font-size: 12px; color: #888; text-align: center; margin-top: 8px; margin-bottom: 16px; }
#reset-hotkeys-btn { width: 100%; padding: 12px; background: rgba(255, 107, 107, 0.1); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.2); border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; }
#reset-hotkeys-btn:hover { background: rgba(255, 107, 107, 0.2); border-color: #ff6b6b; transform: translateY(-2px); }

.hotkeys-modal-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
#close-hotkeys-footer { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), #6b21a8); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s; }
#close-hotkeys-footer:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

/* --- Добавить в плейлист (ФИНАЛЬНЫЙ ФИКС) --- */
#playlist-select-list {
    list-style: none; padding: 0; margin: 0 0 20px 0;
    display: flex; flex-direction: column; gap: 8px;
    max-height: 250px; overflow-y: auto; outline: none;
}
#playlist-select-list li {
    display: flex; align-items: center; justify-content: flex-start;
    padding: 14px 16px; background: rgba(30, 20, 50, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px;
    color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background 0.2s, border-color 0.2s; transform: none; box-shadow: none;
}
#playlist-select-list li:hover {
    background: rgba(138, 43, 226, 0.2); border-color: var(--primary); transform: none;
}
#playlist-select-list li:focus, #playlist-select-list li:active { outline: none; box-shadow: none; }

/* Фикс пустого списка ("Нет плейлистов") */
#playlist-select-list li[style*="rgb(136, 136, 136)"],
#playlist-select-list li[style*="#888"] {
    background: transparent; border: none; color: var(--text-muted);
    justify-content: center; padding: 24px; cursor: default; font-style: italic;
}
#playlist-select-list li[style*="rgb(136, 136, 136)"]:hover,
#playlist-select-list li[style*="#888"]:hover {
    background: transparent; border: none; transform: none; box-shadow: none;
}

/* ==========================================================
   9. УВЕДОМЛЕНИЯ (TOAST)
   ========================================================== */
.toast {
    position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%);
    background: rgba(18, 12, 35, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    color: #fff; padding: 14px 24px; border-radius: 30px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1); border-left: 4px solid var(--primary);
    z-index: 99999; font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes toastFadeOut { from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } to { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); } }

.toast.success { border-left-color: #4dff88; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(77, 255, 136, 0.15); }
.toast.error { border-left-color: #ff6b6b; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 107, 107, 0.15); }
.toast.warning { border-left-color: #ffb347; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 179, 71, 0.15); }
.toast.info { border-left-color: #67e8f9; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(103, 232, 249, 0.15); }

/* ==========================================================
   10. СВЕТЛАЯ ТЕМА
   ========================================================== */
body.light-theme { background: #e8e0f0; color: #1a1a2e; }
body.light-theme .sidebar, body.light-theme header { background: rgba(255,245,255,.8); border-color: rgba(0,0,0,.05); }
body.light-theme .track-card, body.light-theme .bottom-player { background: rgba(255,250,255,.9); border-color: rgba(0,0,0,.1); }
body.light-theme .track-card-title, body.light-theme .player-track-title { color: #1a1a2e; }
body.light-theme .track-card-artist, body.light-theme .player-track-artist { color: #555; }
body.light-theme .dropdown-menu, body.light-theme .player-dropdown, body.light-theme .track-dropdown, body.light-theme .playlist-context-menu, body.light-theme .modal-content { background: rgba(255,250,255,.98); border-color: rgba(0,0,0,.1); }
body.light-theme .dropdown-item, body.light-theme .context-menu-item { color: #444; }
body.light-theme .dropdown-item:hover, body.light-theme .context-menu-item:hover { background: rgba(138,43,226,.1); color: #1a1a2e; }
body.light-theme .sidebar-nav-btn { color: #555; }
body.light-theme .sidebar-nav-btn:hover { background: rgba(0,0,0,.05); color: #1a1a2e; }
body.light-theme .sidebar-nav-btn.active { background: rgba(138,43,226,.1); color: #6b21a8; }
body.light-theme #user-dropdown-menu { background: rgba(255,250,255,.98); border-color: rgba(138,43,226,.2); }
body.light-theme #menu-user-email { border-bottom-color: rgba(0,0,0,.05); }
body.light-theme .dropdown-divider { background: rgba(0,0,0,.05); }
body.light-theme .toast { background: rgba(255,250,255,0.98); color: #1a1a2e; border-color: rgba(0,0,0,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

/* ==========================================================
   11. АДАПТИВ (Планшеты)
   ========================================================== */
@media (max-width: 900px) {
    .search-container, .daily-track-header { display: none; }
    .bottom-player { left: 20px; }
    .player-track-info { width: 200px; }
    .volume-container { display: none; }
}
/* ==========================================================
   КРАСИВЫЙ ЭКРАН ЗАГРУЗКИ ДЛЯ "МОЕЙ ВОЛНЫ"
   ========================================================== */

/* Стильный неоновый спиннер */
.wave-loader {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 25%, #c084fc 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    animation: spinLoader 1s linear infinite;
    box-shadow: 0 0 30px rgba(192, 132, 252, 0.4);
    margin: 0 auto;
}

@keyframes spinLoader {
    100% { transform: rotate(360deg); }
}

/* Немного анимации для текста загрузки */
.wave-header p {
    animation: pulseText 1.5s ease-in-out infinite alternate;
}

@keyframes pulseText {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}
/* ==========================================================
   12. АВТОРИЗАЦИЯ (ДЕСКТОП)
   ========================================================== */
.auth-container {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; background: var(--bg-color);
    overflow: hidden; padding: 20px;
}

/* Плавающие ноты на фоне */
.floating-notes { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.floating-notes span {
    position: absolute; color: rgba(167, 139, 250, 0.4);
    font-size: 24px; animation: floatNote 15s linear infinite;
}
.floating-notes span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; font-size: 32px; }
.floating-notes span:nth-child(2) { left: 80%; top: 15%; animation-delay: -2s; font-size: 28px; }
.floating-notes span:nth-child(3) { left: 25%; top: 80%; animation-delay: -4s; font-size: 40px; }
.floating-notes span:nth-child(4) { left: 70%; top: 70%; animation-delay: -6s; font-size: 20px; }
.floating-notes span:nth-child(5) { left: 50%; top: 10%; animation-delay: -8s; font-size: 36px; }
.floating-notes span:nth-child(6) { left: 85%; top: 50%; animation-delay: -10s; font-size: 24px; }

@keyframes floatNote {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Карточка */
.auth-card {
    position: relative; width: 100%; max-width: 400px;
    background: rgba(18, 12, 35, 0.85); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 24px;
    padding: 40px 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(138, 43, 226, 0.2);
    z-index: 2; animation: authCardIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-icon {
    font-size: 48px; text-align: center; margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(192, 132, 252, 0.6));
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.welcome-text { text-align: center; margin-bottom: 32px; }
.welcome-text span { color: var(--text-muted); font-size: 14px; display: block; margin-bottom: 4px; }
.welcome-text .brand {
    font-size: 32px; font-weight: 900;
    background: linear-gradient(135deg, #ffdb4d, #c084fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px;
}

/* Управление шагами (главный фикс) */
.auth-step { display: none; animation: stepFadeIn 0.4s ease forwards; }
.auth-step.active { display: block; }
@keyframes stepFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Кнопка "Назад" */
.back-btn {
    position: absolute; top: 24px; left: 24px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.05); border-radius: 50%;
    color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 18px;
}
.back-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; transform: scale(1.1); }

.step-email-display { font-size: 14px; color: var(--primary); text-align: center; margin-bottom: 16px; word-break: break-all; }
.verify-hint { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 16px; }

/* Инпуты с плавающим лейблом */
.input-container { position: relative; margin-bottom: 20px; }
.input-container input {
    width: 100%; padding: 20px 16px 8px; background: rgba(30, 20, 50, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
    color: #fff; font-size: 15px; font-family: inherit; outline: none; transition: all 0.2s ease;
}
.input-container label {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 15px; transition: all 0.2s ease; pointer-events: none;
}
.input-container input:focus, .input-container input:not(:placeholder-shown) {
    border-color: var(--primary); background: rgba(40, 25, 65, 0.8);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.15);
}
.input-container input:focus + label, .input-container input:not(:placeholder-shown) + label {
    top: 10px; font-size: 11px; color: var(--primary); transform: translateY(0);
}

/* Кнопки */
.primary-btn {
    width: 100%; padding: 16px; background: linear-gradient(135deg, var(--primary), #6b21a8);
    border: none; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 700;
    font-family: inherit; cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.3); margin-top: 8px;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(167, 139, 250, 0.5); }
.primary-btn:active { transform: translateY(0); }

.secondary-btn {
    width: 100%; padding: 14px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; color: var(--text-muted); font-size: 14px; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all 0.2s ease; margin-top: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.secondary-btn:hover { background: rgba(255, 255, 255, 0.05); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.resend-icon { font-size: 16px; }

/* Ошибки */
.error {
    color: #ff6b6b; font-size: 13px; text-align: center; margin-top: 12px;
    padding: 8px; background: rgba(255, 107, 107, 0.1); border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.2); animation: shake 0.3s ease;
}
.success {
    color: #4dff88; font-size: 13px; text-align: center; margin-top: 12px;
    padding: 8px; background: rgba(77, 255, 136, 0.1); border-radius: 8px;
    border: 1px solid rgba(77, 255, 136, 0.2);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}
.back-btn {
    position: absolute; 
    top: 24px;   /* На одной линии с иконкой ноты */
    left: 24px; 
    width: 40px; 
    height: 40px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: rgba(255, 255, 255, 0); /* Сделали фон светлее */
    border-radius: 50%;
    color: #fff; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 20px;
    z-index: 10;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1); 
    transform: scale(1.05); /* Легкое увеличение при наведении */
}

/* Базовый стиль для всех SVG-иконок */
.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Специфичные размеры */
.mini-player-btn .icon { width: 20px; height: 20px; }
.player-control-btn .icon { width: 28px; height: 28px; }
.player-control-btn.play-btn .icon { width: 36px; height: 36px; }
.player-header-btn .icon { width: 24px; height: 24px; }
.player-action-item .icon { width: 24px; height: 24px; }
.nav-icon .icon { width: 24px; height: 24px; }
.icon-btn .icon { width: 20px; height: 20px; }
.dropdown-item .icon { width: 20px; height: 20px; margin-right: 8px; color: #a0a0c0; }
.sidebar-nav-btn .icon { width: 24px; height: 24px; margin-bottom: 4px; }

/* === СЕРДЕЧКО === */
/* Обводка по умолчанию */
.heart-btn .icon path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Когда добавлен класс .liked — заливаем красным */
.heart-btn.liked .icon {
    color: #ff4d6d !important;
}
.heart-btn.liked .icon path {
    fill: #ff4d6d !important;
    stroke: #ff4d6d !important;
}

/* Кнопка Play/Pause в зависимости от состояния */
.playing .play-btn .icon use {
    href: #icon-pause;
}

/* Стили для SVG-иконки в кнопке "Моя волна" */
.wave-play-btn .wave-btn-svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    margin-right: 4px; /* Небольшой отступ от текста */
}

/* Если кнопка в состоянии "играет", иконка становится фиолетовой (наследуется от кнопки) */
.wave-play-btn.playing .wave-btn-svg {
    fill: #c084fc;
}

/* === ШАПКА ИЗБРАННОГО (ЯНДЕКС СТИЛЬ) === */
.favorites-header {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 20px 16px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.15) 0%, transparent 100%);
    border-radius: 20px;
    position: relative;
}

.fav-cover-large {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a78bfa, #6b21a8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.fav-cover-large .icon {
    width: 60px;
    height: 60px;
    color: #fff;
}

.fav-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.fav-type {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c084fc;
    font-weight: 700;
}

.fav-info h1 {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -1px;
}

.fav-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #a0a0c0;
    font-weight: 500;
}

.fav-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.genre-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.genre-pill:active {
    background: #c084fc;
    border-color: #c084fc;
}

.fav-play-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #c084fc;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(192, 132, 252, 0.4);
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.fav-play-btn .icon {
    width: 28px;
    height: 28px;
    margin-left: 4px; /* Оптический сдвиг треугольника */
}

.fav-play-btn:active {
    transform: scale(0.9);
    background: #a78bfa;
}

/* Для мобилок шапку делаем компактнее */
@media (max-width: 480px) {
    .favorites-header {
        align-items: center;
        padding: 16px 12px;
    }
    .fav-cover-large {
        width: 80px;
        height: 80px;
    }
    .fav-cover-large .icon { width: 40px; height: 40px; }
    .fav-info h1 { font-size: 24px; }
    .fav-play-btn {
        width: 48px;
        height: 48px;
        right: 12px;
        bottom: 16px;
    }
}
/* Переключатель похожих треков */
.similar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0c0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.similar-toggle.active {
    background: rgba(192, 132, 252, 0.15);
    border-color: #c084fc;
    color: #c084fc;
}

.similar-toggle:active {
    transform: scale(0.95);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 14px;
    color: #7a7a9a;
    font-size: 13px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(192, 132, 252, 0.18);
}
.auth-divider span { padding: 0 12px; }

.telegram-login-wrap {
    display: flex;
    justify-content: center;
    min-height: 48px;
    margin-bottom: 8px;
}

.telegram-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    background: #229ED9;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.telegram-login-btn:hover  { background: #1c8abf; }
.telegram-login-btn:active { transform: scale(0.98); }

/* ============================================================
   TELEGRAM AUTH — красивая кнопка с невидимым iframe
   ============================================================ */

/* -------- ВЫБЕРИ СТИЛЬ (одна из трёх строк): -------- */
:root {
    /* Стиль 1 — «Enigma Gradient» (фиолетово-голубой, в стиле приложения) */
    --tg-btn-bg:        linear-gradient(135deg, #a78bfa 0%, #8b5cf6 45%, #22d3ee 100%);

    /* Стиль 2 — «Classic Telegram» (официальный синий) */
    /* --tg-btn-bg:        linear-gradient(135deg, #2AABEE 0%, #229ED9 100%); */

    /* Стиль 3 — «Dark Glass» (стеклянная тёмная) */
    /* --tg-btn-bg:        linear-gradient(135deg, rgba(167,139,250,0.20) 0%, rgba(34,211,238,0.15) 100%); */

    --tg-btn-bg-hover:  linear-gradient(135deg, #b899fb 0%, #9d6ef7 45%, #3ad9ee 100%);
    --tg-btn-color:     #ffffff;
    --tg-btn-radius:    14px;
    --tg-btn-padding:   15px 22px;
    --tg-btn-font:      15px;
    --tg-btn-weight:    700;
    --tg-btn-gap:       10px;
    --tg-btn-shadow:    0 8px 24px rgba(139, 92, 246, 0.45);
    --tg-btn-shadow-h:  0 10px 32px rgba(139, 92, 246, 0.6);
    --tg-btn-icon-size: 22px;
}

/* ============================================================
   Разделитель "или"
   ============================================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: #7a7a9a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(192, 132, 252, 0.35),
        transparent);
}
.auth-divider span { padding: 0 4px; }

/* ============================================================
   Кнопка Telegram
   ============================================================ */
.telegram-auth-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tg-btn-gap);
    width: 100%;
    min-height: 52px;
    padding: var(--tg-btn-padding);
    background: var(--tg-btn-bg);
    color: var(--tg-btn-color);
    border: none;
    border-radius: var(--tg-btn-radius);
    font-family: inherit;
    font-size: var(--tg-btn-font);
    font-weight: var(--tg-btn-weight);
    letter-spacing: 0.3px;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    box-shadow: var(--tg-btn-shadow);
    transition:
        transform .18s cubic-bezier(.4, 0, .2, 1),
        box-shadow .25s ease,
        background .25s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Внутренний светлый слой для объёма */
.telegram-auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.20) 0%,
        transparent 45%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Shimmer-блик, пробегающий по кнопке */
.telegram-auth-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(110deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    transition: left .7s ease;
    pointer-events: none;
    z-index: 2;
}
.telegram-auth-btn:not(:disabled):hover::after { left: 120%; }

/* Ховер / тап */
@media (hover: hover) {
    .telegram-auth-btn:not(:disabled):hover {
        background: var(--tg-btn-bg-hover);
        box-shadow: var(--tg-btn-shadow-h);
        transform: translateY(-1px);
    }
}
.telegram-auth-btn:not(:disabled):active {
    transform: scale(0.975);
    box-shadow: var(--tg-btn-shadow);
}

/* Иконка */
.telegram-auth-btn .tg-icon {
    width: var(--tg-btn-icon-size);
    height: var(--tg-btn-icon-size);
    flex-shrink: 0;
    color: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    transition: transform .25s ease;
    z-index: 3;
}
.telegram-auth-btn:not(:disabled):hover .tg-icon {
    transform: rotate(-12deg) scale(1.08);
}

/* Текст */
.telegram-auth-btn .tg-text {
    line-height: 1.1;
    white-space: nowrap;
    z-index: 3;
}

/* ============================================================
   Состояние загрузки
   ============================================================ */
.telegram-auth-btn.loading {
    cursor: progress;
    pointer-events: none;
}
.telegram-auth-btn.loading .tg-icon,
.telegram-auth-btn.loading .tg-text {
    opacity: 0.55;
}
.telegram-auth-btn .tg-loader {
    position: absolute;
    right: 18px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.30);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tgSpin 0.75s linear infinite;
    display: none;
    z-index: 3;
}
.telegram-auth-btn.loading .tg-loader { display: block; }

@keyframes tgSpin { to { transform: rotate(360deg); } }

/* ============================================================
   Пульсирующее свечение (только когда кнопка не в loading)
   ============================================================ */
.telegram-auth-btn:not(.loading) {
    animation: tgPulse 3s ease-in-out infinite;
}
@keyframes tgPulse {
    0%, 100% { box-shadow: var(--tg-btn-shadow); }
    50%      { box-shadow: var(--tg-btn-shadow-h); }
}

/* ============================================================
   Невидимый iframe Telegram поверх кнопки
   ============================================================ */
.telegram-widget-host {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.001;      /* «невидимый», но кликабельный */
    pointer-events: auto;
    cursor: pointer;
    border-radius: inherit;
    z-index: 5;
}

.telegram-widget-host iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    transform: none !important;
    border-radius: inherit !important;
}

/* Скрыть кнопку, если бот не настроен */
.telegram-auth-btn.hidden { display: none !important; }

/* ============================================================
   Анимация появления
   ============================================================ */
.telegram-auth-btn {
    animation:
        tgPulse 3s ease-in-out infinite,
        tgFadeIn 0.5s ease-out backwards;
}
@keyframes tgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   СВЕТЛАЯ ТЕМА — корректировки
   ============================================================ */
body.light-theme .auth-divider {
    color: #7a6a98;
}
body.light-theme .auth-divider::before,
body.light-theme .auth-divider::after {
    background: linear-gradient(90deg,
        transparent,
        rgba(139, 92, 246, 0.35),
        transparent);
}

body.light-theme .telegram-auth-btn {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.30);
    color: #fff;
}
body.light-theme .telegram-auth-btn:not(:disabled):hover {
    box-shadow: 0 10px 32px rgba(124, 58, 237, 0.45);
}

/* ============================================================
   Адаптив: чуть компактнее на маленьких экранах
   ============================================================ */
@media (max-width: 400px) {
    :root {
        --tg-btn-padding: 13px 18px;
        --tg-btn-font: 14px;
        --tg-btn-icon-size: 20px;
    }
    .telegram-auth-btn { min-height: 48px; }
}
/* ============================================================
   TELEGRAM AUTH — обёртка с растянутым прозрачным iframe
   ============================================================ */
.telegram-auth-wrap {
    position: relative !important;
    width: 100% !important;
    height: 52px !important;
    margin-top: 4px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}

.telegram-auth-btn {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 45%, #22d3ee 100%) !important;
    color: #fff !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45) !important;
    pointer-events: none !important;
    user-select: none !important;
}

.telegram-auth-btn .tg-icon {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
}

.telegram-auth-btn .tg-text {
    white-space: nowrap !important;
    z-index: 2 !important;
}

.telegram-auth-btn .tg-loader {
    display: none !important;
}

.telegram-widget-host {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10 !important;
    opacity: 0.001 !important;
    pointer-events: auto !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

.telegram-widget-host iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    transform: none !important;
}

.telegram-auth-wrap.hidden {
    display: none !important;
}

.telegram-auth-wrap.loading .telegram-auth-btn {
    opacity: 0.65 !important;
}

/* ============================================================
   TELEGRAM AUTH — обёртка с растянутым прозрачным iframe
   ============================================================ */
.telegram-auth-wrap {
    position: relative !important;
    width: 100% !important;
    height: 52px !important;
    margin-top: 4px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}

.telegram-auth-btn {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 45%, #22d3ee 100%) !important;
    color: #fff !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45) !important;
    pointer-events: none !important;
    user-select: none !important;
    transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}

.telegram-auth-wrap:hover .telegram-auth-btn {
    box-shadow: 0 10px 32px rgba(139, 92, 246, 0.6) !important;
    transform: translateY(-1px) !important;
}

.telegram-auth-wrap:active .telegram-auth-btn {
    transform: scale(0.975) !important;
}

.telegram-auth-btn .tg-icon {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
    transition: transform 0.25s ease !important;
}

.telegram-auth-wrap:hover .tg-icon {
    transform: rotate(-12deg) scale(1.08) !important;
}

.telegram-auth-btn .tg-text {
    white-space: nowrap !important;
    z-index: 2 !important;
}

.telegram-auth-btn .tg-loader {
    display: none !important;
}

.telegram-widget-host {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10 !important;
    opacity: 0.001 !important;
    pointer-events: auto !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    cursor: pointer !important;
}

.telegram-widget-host iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    transform: none !important;
    border-radius: 14px !important;
}

.telegram-auth-wrap.hidden {
    display: none !important;
}

.telegram-auth-wrap.loading .telegram-auth-btn {
    opacity: 0.65 !important;
}

/* ============ ПРОФИЛЬ В МЕНЮ (TG-юзер) ============ */
.user-menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(192, 132, 252, 0.18);
    margin-bottom: 8px;
}

.user-menu-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(192, 132, 252, 0.45);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.25);
}

.user-menu-avatar.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0;
}

.user-menu-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.user-menu-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-username {
    font-size: 12px;
    color: #a0a0c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Светлая тема */
body.light-theme .user-menu-name      { color: #2a1a48; }
body.light-theme .user-menu-username  { color: #7a6a98; }
body.light-theme .user-menu-profile   { border-bottom-color: rgba(139, 92, 246, 0.18); }
body.light-theme .user-menu-avatar    { border-color: rgba(139, 92, 246, 0.35); }

.telegram-auth-wrap.native-mode .telegram-auth-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
}
.telegram-auth-wrap.native-mode .telegram-widget-host {
    display: none !important;
}