
        :root {
            --bg-color: #0d0d12;
            --panel-bg: #1a1a24;
            --accent-primary: #3399ff; 
            --accent-secondary: #0066cc;
            --accent-rgb: 51, 153, 255;
            --text-main: #ffffff;
            --text-muted: #a0a0b0;
            --border-radius: 12px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            height: 100vh;       
            height: 100dvh;      
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* Minimal Header */
        header {
            flex-shrink: 0;
            height: 56px; 
            padding: 0 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: var(--panel-bg);
            border-bottom: 2px solid var(--accent-primary);
            box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.2);
            z-index: 100;
        }

        .logo-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .logo-text {
            font-family: 'Montserrat', sans-serif;
            font-size: 26px; 
            font-weight: 800;
            color: var(--accent-primary);
            letter-spacing: 1px;
            text-transform: uppercase;
        }

        .logo-text span {
            font-family: 'Pacifico', cursive;
            color: white; 
            font-size: 24px;
            text-transform: none;
            margin-left: 5px;
            font-weight: normal;
        }

        .nav-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .session-badge {
            background: #2a2a38; 
            color: var(--text-muted); 
            font-size: 14px;
            padding: 6px 12px; 
            border-radius: 15px; 
            font-weight: bold; 
            letter-spacing: 1px;
            display: none; /* hidden until JS populates it */
        }

        .setup-link {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 14px;
            font-weight: bold;
            padding: 6px 12px;
            border-radius: 15px;
            background: #2a2a38;
            transition: 0.3s;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .setup-link:hover {
            color: white;
            background: var(--accent-primary);
        }

        .search-container {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-shrink: 0;
        }

        .search-container input {
            padding: 8px 15px; 
            border-radius: 20px;
            border: 1px solid #333;
            background-color: #000;
            color: white;
            flex-grow: 1; 
            min-width: 0; /* Allows input to shrink gracefully */
            outline: none;
            transition: 0.3s;
            font-size: 14px;
        }

        .search-container input:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
        }

        .search-container button {
            padding: 8px 16px; 
            border-radius: 20px;
            border: none;
            background: var(--accent-primary);
            color: white; 
            font-weight: bold;
            font-size: 14px;
            flex-shrink: 0; /* Prevents button from being squished */
            transition: none; /* Disables the global button transition */
            cursor: pointer;
        }
        
        .search-container button:hover, .search-container button:active {
            transform: none; /* Disables scale animation */
            box-shadow: none; /* Disables glowing shadow */
        }

        .input-wrapper {
            position: relative;
            flex-grow: 1;
            display: flex;
            min-width: 0;
        }

        .input-wrapper input {
            width: 100%;
            padding-right: 30px !important;
        }

        .clear-search-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #aaa;
            font-size: 14px;
            display: none;
        }

        .clear-search-icon:hover {
            color: white;
        }

        button {
            padding: 8px 16px; 
            border-radius: 20px;
            border: none;
            background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
            color: white; 
            font-weight: bold;
            font-size: 14px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        button:hover {
            transform: scale(1.05);
            box-shadow: 0 0 10px var(--accent-primary);
        }

        /* Toggle Switch CSS */
        .switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 24px; border: 1px solid #555;}
        .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
        input:checked + .slider { background-color: #00ff00; border-color: #00ff00; }
        input:checked + .slider:before { transform: translateX(20px); }

        /* Main Layout */
        main {
            flex: 1;
            min-height: 0; 
            display: grid;
            grid-template-columns: 2fr 1fr;
            grid-template-rows: minmax(0, 1fr); 
            gap: 20px;
            padding: 20px 24px;
            overflow: hidden; 
        }

        /* Video Player Section */
        .player-section {
            background-color: var(--panel-bg);
            border-radius: var(--border-radius);
            padding: 15px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            height: 100%;
            overflow: hidden;
            position: relative;
        }

        .video-container {
            position: relative;
            flex-grow: 1; 
            min-height: 0; 
            overflow: hidden;
            border-radius: 8px;
            background-color: #000;
            border: 1px solid var(--accent-primary);
            box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
        }

        .video-container iframe {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            pointer-events: none; 
        }

        /* Fullscreen hidden controls logic */
        .video-container.hide-controls {
            cursor: none;
        }
        
        .video-container.hide-controls .video-overlay,
        .video-container.hide-controls .video-overlay.active-touch {
            opacity: 0 !important;
            cursor: none;
            pointer-events: none !important;
        }

        /* Placeholder Video */
        .placeholder-video {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            object-fit: cover;
            z-index: 2; 
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.4s ease;
        }

        .video-container.is-idle .placeholder-video {
            opacity: 1;
            pointer-events: auto;
        }
        
        .video-container.is-idle .video-overlay {
            display: none !important;
        }

        .idle-text-fallback {
            background-color: white;
            color: red;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 2rem;
            font-weight: 800;
            font-family: 'Montserrat', sans-serif;
            text-align: center;
            letter-spacing: 1px;
        }

        /* Custom Video Overlay */
        .video-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 30px;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 5;
            cursor: pointer; 
            pointer-events: none;
        }

        @media (hover: hover) {
            .video-container:hover .video-overlay {
                opacity: 1;
                pointer-events: auto;
            }
        }

        .video-overlay.active-touch {
            opacity: 1;
            pointer-events: auto;
        }

        .overlay-btn {
            background: rgba(var(--accent-rgb), 0.8);
            border: 2px solid white;
            border-radius: 50%;
            width: 60px; height: 60px;
            font-size: 20px;
            color: white;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: 0.2s;
            box-shadow: 0 0 15px rgba(0,0,0,0.5);
        }

        .overlay-btn:hover {
            transform: scale(1.1);
            background: var(--accent-primary);
        }

        /* Mic Indicator Overlay */
        .mic-indicator-overlay {
            position: absolute;
            top: 15px;
            right: 15px;
            z-index: 10;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            color: #aaa;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            padding: 6px 10px;
            border-radius: 12px;
            transition: 0.3s ease;
            pointer-events: none;
        }
        
        .mic-indicator-overlay.active {
            color: #00ff00;
            box-shadow: 0 0 8px rgba(0,255,0,0.4);
            background: rgba(0, 20, 0, 0.7);
        }

        /* Voice Animator Overlay */
        .voice-animator {
            position: absolute;
            bottom: 15px;
            right: 15px;
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 4px;
            height: 24px;
            pointer-events: none;
        }

        .voice-animator .bar {
            width: 4px;
            height: 4px;
            background-color: #00ff00;
            border-radius: 2px;
            transition: height 0.05s ease;
            box-shadow: 0 0 5px rgba(0,255,0,0.5);
        }

        /* Song Tooltips */
        .song-tooltip {
            position: absolute;
            left: 15px;
            z-index: 20;
            color: white;
            background: rgba(var(--accent-rgb), 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: bold;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.4s ease;
            max-width: calc(100% - 130px);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: left;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }
        
        .song-tooltip.show { opacity: 1; }
        #reservedSongTooltip { top: 15px; }
        #nextSongTooltip { top: 15px; }
        
        /* Scoring System UI */
        .score-screen {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 50;
            display: none; 
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border-radius: 8px;
            animation: fadeIn 0.5s ease;
        }
        
        .score-screen.active { display: flex; }
        .score-title { font-size: 32px; color: white; margin-bottom: 20px; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 0 15px var(--accent-primary); }
        .score-number { font-size: 140px; font-weight: 900; color: #ffd700; text-shadow: 0 0 40px rgba(255, 215, 0, 0.8); margin: 0; line-height: 1; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        .current-song-info { flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;}
        .current-song-info h2 { margin-bottom: 5px; color: var(--accent-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 20px; width: 100%; }

        .controls-bar { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
        .controls-bar button { color: white; border: none; padding: 10px 20px; font-weight: bold; font-size: 14px; border-radius: 20px; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
        
        #mainPlayBtn { background: linear-gradient(45deg, #00b09b, #96c93d); box-shadow: 0 4px 10px rgba(0, 176, 155, 0.3); }
        #mainPlayBtn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0, 176, 155, 0.5); }
        #mainNextBtn { background: linear-gradient(45deg, #ff512f, #dd2476); box-shadow: 0 4px 10px rgba(255, 81, 47, 0.3); }
        #mainNextBtn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(255, 81, 47, 0.5); }

        /* Sidebar Structure */
        .sidebar { display: flex; flex-direction: column; gap: 20px; height: 100%; overflow: hidden; }
        .panel { background-color: var(--panel-bg); border-radius: var(--border-radius); padding: 15px; display: flex; flex-direction: column; flex: 1; min-height: 0; }

        /* Tabs System */
        .tabs { display: flex; gap: 15px; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 10px; flex-shrink: 0; }
        .tab-btn { background: none; border: none; color: var(--text-muted); padding: 5px 0; font-size: 14px; font-weight: bold; cursor: pointer; border-radius: 0; box-shadow: none; display: flex; align-items: center; gap: 5px; }
        .tab-btn:hover { transform: none; color: white; box-shadow: none; }
        .tab-btn.active { color: var(--accent-primary); border-bottom: 2px solid var(--accent-primary); }

        .queue-badge { background-color: #444; color: white; padding: 2px 6px; border-radius: 12px; font-size: 11px; font-weight: bold; transition: 0.3s; }
        .tab-btn.active .queue-badge { background-color: var(--accent-primary); }

        /* Lists and Scrolling */
        .popular-wrapper, .search-wrapper { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; overflow-y: auto; padding-right: 5px; }
        .popular-wrapper::-webkit-scrollbar, .search-wrapper::-webkit-scrollbar { width: 6px; }
        .popular-wrapper::-webkit-scrollbar-thumb, .search-wrapper::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

        .song-list { list-style: none; display: block; }
        #popularList, #searchList { overflow-y: visible; flex-grow: 0; min-height: auto; padding-right: 0; }
        
        #queueList { overflow-y: auto; flex-grow: 1; min-height: 0; padding-right: 5px; }
        #queueList::-webkit-scrollbar { width: 6px; }
        #queueList::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

        /* Focus highlights for scrollable areas */
        .popular-wrapper:focus-visible, 
        .search-wrapper:focus-visible, 
        #queueList:focus-visible {
            outline: 2px solid var(--accent-primary);
            outline-offset: -2px;
            border-radius: 8px;
        }

        .song-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background-color: #22222e; margin-bottom: 8px; border-radius: 8px; transition: 0.2s; }
        .song-item.dragging { opacity: 0.5; background-color: rgba(var(--accent-rgb), 0.2); border: 1px dashed var(--accent-primary); }
        .song-item:hover { background-color: #2a2a38; }

        .song-details { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; margin: 0 10px; }
        .song-title { font-weight: bold; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .song-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        .action-btn { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); padding: 4px 8px; font-size: 11px; flex-shrink: 0; border-radius: 6px; transition: 0.2s; }
        .action-btn.add { border-color: var(--accent-primary); color: var(--accent-primary); }
        .action-btn.add:hover { background: var(--accent-primary); color: white; font-weight: bold;}
        .action-btn.add.success-state { background-color: #00ff00 !important; border-color: #00ff00 !important; color: #000 !important; font-weight: bold; pointer-events: none; }
        .action-btn.delete { border-color: #ff3333; color: #ff3333; margin-left: 5px;}
        .action-btn.delete:hover { background: #ff3333; color: white; }

        .drag-handle { cursor: grab; font-size: 16px; color: var(--text-muted); padding: 0 5px; touch-action: none; }
        .drag-handle:active { cursor: grabbing; }

        .info-msg { color: gray; font-size: 13px; text-align: center; margin-top: 20px; }
        .error-msg { color: var(--accent-primary); font-size: 14px; text-align: center; margin-top: 20px; padding: 10px; background: rgba(var(--accent-rgb), 0.1); border-radius: 8px; border: 1px solid var(--accent-primary); }

        /* View More Button */
        .view-more-btn {
            background: transparent;
            border: 1px solid var(--text-muted);
            color: var(--text-main);
            padding: 10px;
            font-size: 13px;
            border-radius: 8px;
            transition: 0.2s;
            width: 100%;
            margin-top: 5px;
            margin-bottom: 15px;
            cursor: pointer;
            font-weight: bold;
        }
        .view-more-btn:hover { transform: none; box-shadow: none; background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
        .view-more-btn:disabled { background: #22222e; border-color: #333; color: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }

        /* Remote Modal CSS */
        .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); justify-content: center; align-items: center; }
        .modal-content { background-color: var(--panel-bg); padding: 30px; border-radius: var(--border-radius); text-align: center; border: 1px solid var(--accent-primary); max-width: 90%; width: 350px; }
        .modal-btn { display: inline-block; padding: 10px 20px; background: var(--accent-primary); color: white; text-decoration: none; border-radius: 20px; font-weight: bold; font-size: 14px;}
        .remote-link-box { color: var(--text-main); font-size: 13px; margin-bottom: 20px; word-break: break-all; background: #000; padding: 10px; border-radius: 8px; border: 1px solid #333; user-select: all; font-family: monospace; }

        @media (max-width: 900px) {
            body { height: 100dvh; overflow: hidden; } 
            main { display: flex; flex-direction: column; padding: 0; gap: 0; }
            header { position: relative; } 
            .player-section { flex-shrink: 0; height: auto; border-radius: 0; padding: 10px 15px; border-left: none; border-right: none; box-shadow: 0 4px 10px rgba(0,0,0,0.5); z-index: 10; }
            .video-container { flex: 0 0 220px; } 
            .sidebar { flex: 1; min-height: 0; padding: 10px 15px; }
            .logo-text { font-size: 20px; }
            .current-song-info h2 { font-size: 18px; }
            .current-song-info p { font-size: 12px; }
            .controls-bar button { padding: 6px 12px; font-size: 12px; }
            .overlay-btn { width: 50px; height: 50px; font-size: 18px; }
            .score-number { font-size: 90px; }
            .score-title { font-size: 24px; }
        }

        @media (max-width: 500px) {
            .search-container { flex-direction: column; }
            .search-container input { width: 100%; }
            .tabs { flex-wrap: wrap; justify-content: center; } 
            .session-badge { font-size: 12px; padding: 6px 8px; letter-spacing: normal; }
            .logo-text { display: none; } 
            .setup-link span { display: none; }
            .nav-controls { gap: 5px; }
        }
    