:root {
            --bg-color: #000000;
            --surface-color: #121212;
            --surface-hover: #1f1f1f;
            --text-primary: #ffffff;
            --text-secondary: #a7a7a7;
            --accent-color: #ff6b00;
            --nav-height: 65px;
        }
        
        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            margin: 0;
            padding: 0;
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding-bottom: calc(var(--nav-height) + 60px);
            overflow-x: hidden;
            overscroll-behavior-y: none; /* Отключает pull-to-refresh на мобильных браузерах */
        }

        .header {
            width: 100%;
            padding: 16px 0;
            text-align: center;
            position: sticky;
            top: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            z-index: 10;
        }

        .header h1 {
            margin: 0;
            font-weight: 700;
            font-size: 22px;
            letter-spacing: -0.5px;
        }

        .header h1 span {
            color: var(--accent-color);
        }

        .tab-content {
            display: none;
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            flex-grow: 1;
            padding: 0 16px;
            animation: fadeIn 0.3s ease;
        }

        .tab-content.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* --- SEARCH TAB --- */
        .search-container {
            margin-top: 16px;
        }

        .search-box {
            display: flex;
            align-items: center;
            background: var(--surface-color);
            border-radius: 12px;
            padding: 4px 12px;
            border: 1px solid #333;
        }

        .search-box:focus-within {
            border-color: var(--accent-color);
        }

        .search-input {
            flex-grow: 1;
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 16px;
            padding: 12px 0;
            outline: none;
            margin-left: 8px;
        }

        .search-btn {
            background: transparent;
            border: none;
            padding: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
        }
        .search-btn svg {
            fill: var(--text-secondary);
        }

        .results-container {
            margin-top: 20px;
        }
        
        .loader {
            display: none;
            text-align: center;
            margin-top: 40px;
            color: var(--text-secondary);
        }
        .loader-spinner {
            border: 3px solid rgba(255,204,0,0.1);
            border-top: 3px solid var(--accent-color);
            border-radius: 50%;
            width: 30px; height: 30px;
            animation: spin 1s linear infinite;
            margin: 0 auto 10px;
        }
        @keyframes spin { 100% { transform: rotate(360deg); } }

        .track-card {
            display: flex;
            align-items: center;
            padding: 8px 0;
            transition: opacity 0.2s, background-color 0.3s;
            cursor: pointer;
            margin-bottom: 8px;
            border-radius: 8px;
        }
        .track-card:active { opacity: 0.6; }
        .track-card.playing {
            background-color: rgba(255, 107, 0, 0.15);
            border-left: 3px solid var(--accent-color);
            padding-left: 5px;
        }
        .track-card.playing .track-title {
            color: var(--accent-color);
        }

        .track-cover {
            width: 50px; height: 50px;
            border-radius: 6px;
            object-fit: cover;
            background-color: #222;
            margin-right: 12px;
            flex-shrink: 0;
        }

        .track-info {
            flex-grow: 1;
            overflow: hidden;
            border-bottom: 1px solid #222;
            padding-bottom: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .track-text {
            overflow: hidden;
            display: flex;
            flex-direction: column;
            width: 100%;
        }

        .track-title {
            font-size: 15px; font-weight: 500;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            margin-bottom: 3px;
        }

        .track-artist {
            font-size: 13px; color: var(--text-secondary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }

        .track-more {
            fill: var(--text-secondary);
            width: 20px; height: 20px;
            margin-left: 10px;
            flex-shrink: 0;
        }
        
        .empty-state { text-align: center; color: var(--text-secondary); margin-top: 60px; font-size: 14px; }
        .error-state { color: #ff4d4d; margin-top: 20px; padding: 12px; background: rgba(255, 77, 77, 0.1); border-radius: 8px; font-size: 14px; text-align: center;}

        /* --- MINI PLAYER --- */
        .mini-player {
            position: fixed;
            bottom: var(--nav-height);
            left: 0;
            right: 0;
            height: 60px;
            background: rgba(30, 30, 30, 0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid #333;
            display: flex;
            flex-direction: column;
            z-index: 99;
            transform: translateY(150px);
            visibility: hidden;
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
            user-select: none;
            touch-action: none;
        }

        .mini-player.visible {
            transform: translateY(0);
            visibility: visible;
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0s;
        }

        .mp-progress-bg {
            position: absolute;
            top: -7px;
            left: 0;
            width: 100%;
            height: 14px;
            background: transparent;
            cursor: pointer;
            z-index: 100;
        }
        .mp-progress-track {
            position: absolute;
            top: 7px;
            left: 0; right: 0;
            height: 2px;
            background: rgba(255,255,255,0.1);
            pointer-events: none;
        }
        .mp-progress {
            width: 0%;
            height: 100%;
            background: var(--accent-color);
        }

        .mp-content {
            flex-grow: 1;
            display: flex;
            align-items: center;
            padding: 0 12px;
        }

        .mp-cover {
            width: 44px;
            height: 44px;
            border-radius: 4px;
            object-fit: cover;
            margin-right: 12px;
            background: #222;
        }

        .mp-info-click {
            flex-grow: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .mp-title {
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            margin-bottom: 2px;
            color: var(--text-primary);
        }

        .mp-artist {
            font-size: 12px;
            color: var(--text-secondary);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }

        .mp-controls {
            display: flex;
            align-items: center;
        }

        .mp-btn {
            background: transparent;
            border: none;
            padding: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .mp-btn svg {
            width: 24px;
            height: 24px;
            fill: var(--text-primary);
        }

        /* --- FULL PLAYER --- */
        .full-player {
            position: fixed; top: 0; left: 0; right: 0; bottom: var(--nav-height);
            background: linear-gradient(180deg, #2a2a2a 0%, var(--surface-color) 100%);
            z-index: 101;
            display: flex; flex-direction: column;
            transform: translateY(150vh);
            visibility: hidden;
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
            padding: 20px;
            box-sizing: border-box;
            user-select: none;
            touch-action: none;
        }
        .full-player.visible {
            transform: translateY(0);
            visibility: visible;
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0s;
        }
        .fp-header {
            display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;
        }
        .fp-header span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--text-secondary); text-align: center;}
        .fp-btn { background: none; border: none; padding: 8px; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; }
        .fp-btn svg { width: 28px; height: 28px; fill: white; }
        
        .fp-cover {
            width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; margin-bottom: 40px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.5); background: #222;
            max-height: 40vh; max-width: 40vh; margin-left: auto; margin-right: auto;
        }

        .fp-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
        .fp-text { overflow: hidden; flex-grow: 1; padding-right: 16px; }
        .fp-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;}
        .fp-artist { font-size: 16px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .fp-like-btn { background: none; border: none; padding: 8px; cursor: pointer; flex-shrink: 0; }
        .fp-like-btn svg { width: 28px; height: 28px; fill: var(--text-primary); }

        .fp-progress-container { margin-bottom: 40px; }
        .fp-progress-bg { width: 100%; height: 24px; background: transparent; cursor: pointer; margin-bottom: 5px; position:relative; display: flex; align-items: center;}
        .fp-progress-track { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; position: relative; pointer-events: none;}
        .fp-progress { height: 100%; background: white; border-radius: 2px; position: absolute; left:0; top:0; width:0%; pointer-events: none;}
        .fp-progress::after {
            content: ''; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; background: white; border-radius: 50%;
        }
        .fp-time-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

        .fp-controls { display: flex; justify-content: space-around; align-items: center; margin-bottom: 20px;}
        .fp-btn-main { background: none; border: none; padding: 10px; cursor: pointer; }
        .fp-btn-main svg { width: 36px; height: 36px; fill: white; }
        .fp-btn-play { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-color); border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; }
        .fp-btn-play svg { width: 32px; height: 32px; fill: black; }


        /* --- BOTTOM NAV --- */
        .bottom-nav {
            position: fixed; bottom: 0; left: 0; right: 0;
            height: var(--nav-height);
            background: rgba(18, 18, 18, 0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid #2a2a2a;
            display: flex; justify-content: space-around; align-items: center;
            z-index: 102; /* Всегда поверх */
        }
        .nav-item {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            color: var(--text-secondary); flex: 1; height: 100%; transition: color 0.2s; cursor: pointer;
        }
        .nav-item.active { color: var(--accent-color); }
        .nav-item svg { width: 24px; height: 24px; fill: currentColor; margin-bottom: 4px; transition: transform 0.2s; }
        .nav-item.active svg { transform: scale(1.1); }
        .nav-item span { font-size: 10px; font-weight: 500; }

        .coming-soon { text-align: center; margin-top: 100px; color: var(--text-secondary); }
        .coming-soon svg { width: 48px; height: 48px; fill: var(--text-secondary); opacity: 0.5; margin-bottom: 16px; }

        .glass-back-btn {
            background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); display: inline-flex; justify-content: center; align-items: center;
            border: none; border-radius: 50%; width: 44px; height: 44px; cursor: pointer; margin-bottom: 20px;
        }
        .glass-back-btn svg { fill: white; width: 24px; height: 24px; }
        .create-pl-btn {
            background: rgba(42, 171, 238, 0.1); color: #2AABEE; border: 1px dashed #2AABEE;
            border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); z-index: 1000;
            display: none; opacity: 0; transition: opacity 0.3s;
        }
        .modal-overlay.open { opacity: 1; display: block; }
        .bottom-sheet {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: #1a1a1a; border-radius: 24px 24px 0 0;
            padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
            z-index: 1001; transform: translateY(100%); display: none;
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        }
        .bottom-sheet.open { transform: translateY(0); display: block; }
        .bs-handler { width: 40px; height: 4px; background: #555; border-radius: 2px; margin: 0 auto 20px; }
        .bs-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .bs-item { display: flex; align-items: center; padding: 16px 0; border-bottom: 1px solid #2a2a2a; font-size: 16px; cursor: pointer; }
        .bs-item:last-child { border-bottom: none; }
        .bs-item svg { width: 24px; height: 24px; fill: var(--text-primary); margin-right: 16px; flex-shrink: 0; }
        .settings-modal {
            position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
            background: var(--surface-color); border-radius: 20px; padding: 24px;
            width: 90%; max-width: 400px; z-index: 1001;
            display: none; opacity: 0; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            border: 1px solid #333;
        }
        .settings-modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; display: block; }
        .settings-input { width: 100%; background: #000; border: 1px solid #333; color: white; padding: 12px; border-radius: 8px; margin-bottom: 16px; font-size: 16px; outline: none; box-sizing: border-box; }
        .settings-input:focus { border-color: var(--accent-color); }