html, body { overscroll-behavior-y: none; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none; /* Firefox */
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    height: 100%;
}

@supports (-webkit-touch-callout: none) {
    html {
        height: -webkit-fill-available;
    }
}

:root {
    --bg-primary: linear-gradient(135deg, #FF6B35 0%, #F7931E 50%, #FDC830 100%);
    --bg-secondary: rgba(255, 250, 245, 0.95);
    --bg-glass: rgba(255, 250, 245, 0.85);
    --text-primary: #2C1810;
    --text-secondary: #8B5A3C;
    --accent: #FF6B35;
    --accent-hover: #E85A2A;
    --shadow: rgba(255, 107, 53, 0.25);
    --overlay: rgba(0, 0, 0, 0.3);
    --divider: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --bg-primary: linear-gradient(135deg, #0a0a0f 0%, #15151f 50%, #1a1a28 100%);
    --bg-secondary: rgba(12, 12, 18, 0.98);
    --bg-glass: rgba(20, 20, 30, 0.85);
    --text-primary: #e8e8f0;
    --text-secondary: #8a8a9a;
    --accent: #c8c8d8;
    --accent-hover: #b0b0c0;
    --shadow: rgba(200, 200, 216, 0.15);
    --overlay: rgba(0, 0, 0, 0.85);
    --divider: rgba(200, 200, 216, 0.08);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100vh;
    height: -webkit-fill-available;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    margin: 0;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.container {
    max-width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    margin: 0 auto;
    padding: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    background: var(--bg-primary);
}

img {
    max-width: 100%;
    height: auto;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    background: transparent;
    border-radius: 0;
    padding: 6px 8px;
    padding-top: max(6px, env(safe-area-inset-top));
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

body.dark-theme .top-bar {
    border: none;
    background: transparent;
}

.logo {
    flex-shrink: 0;
    display: none;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

body.dark-theme .logo h1 {
    background: linear-gradient(135deg, #c8c8d8, #e0e0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}



.search-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0 16px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    min-height: 36px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-theme .search-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.3);
}

body.dark-theme .search-container:focus-within {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

#searchInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    font-weight: 500;
}

#searchInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#searchInput::-webkit-search-cancel-button,
#searchInput::-webkit-search-decoration,
#searchInput::-webkit-search-results-button,
#searchInput::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.ghost-search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.3s ease;
}

.search-container:focus-within .ghost-search-btn {
    color: var(--accent);
}

body.dark-theme .search-container:focus-within .ghost-search-btn {
    color: #ffffff;
}

.clear-search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.dark-theme .clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 16px;
    box-shadow: 0 12px 40px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    max-height: 380px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    padding: 4px;
}

body.dark-theme .search-popup {
    border-color: rgba(200, 200, 216, 0.1);
    background: rgba(12, 12, 18, 0.95);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-list {
    max-height: 364px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.search-results-list::-webkit-scrollbar {
    width: 4px;
}

.search-results-list::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 68px;
}

.result-item:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: translateX(3px);
}

body.dark-theme .result-item:hover {
    background: rgba(200, 200, 216, 0.08);
}

.result-thumbnail {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-theme .result-thumbnail {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.result-channel {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-options {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.result-options:hover {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
    transform: scale(1.05);
}

body.dark-theme .result-options:hover {
    background: rgba(200, 200, 216, 0.12);
}

.room-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: none;
    touch-action: manipulation;
}

body.dark-theme .room-btn {
    background: transparent;
    color: var(--text-primary);
}

body.can-hover .room-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

body.dark-theme.can-hover .room-btn:hover {
    background: rgba(200, 200, 216, 0.15);
}



.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    position: relative;
    z-index: 1;
}

.player-card {
    background: var(--bg-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

body.dark-theme .player-card {
    border-color: rgba(200, 200, 216, 0.1);
    background: rgba(20, 20, 30, 0.65);
}

.player-media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-bottom: 16px;
}

.player-thumbnail {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #FDC830);
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(255, 107, 53, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 auto;
}

body.dark-theme .player-thumbnail {
    background: linear-gradient(135deg, #2a2a3a, #3a3a4a);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.player-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08), 0 8px 28px rgba(255, 107, 53, 0.3);
}

body.dark-theme .player-thumbnail:hover {
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 8px 28px rgba(0, 0, 0, 0.6);
}

.player-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-thumbnail::after {
    content: 'MP3fy';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.85;
    pointer-events: none;
    z-index: 10;
}

body.dark-theme .player-thumbnail::after {
    background: rgba(10, 10, 15, 0.75);
}

.no-music-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

body.dark-theme .no-music-placeholder {
    color: rgba(200, 200, 216, 0.8);
}

.no-music-placeholder svg {
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.no-music-placeholder p {
    font-size: 0.9rem;
    font-weight: 600;
}

.player-info {
    margin-bottom: 10px;
    text-align: center;
    flex-shrink: 0;
    padding: 0 8px;
}

.player-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.player-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.controls-wrapper {
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 16px;
    padding-bottom: 12px;
}

.volume-control-vertical {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    gap: 10px;
    margin: 0 auto 20px;
}

body.dark-theme .volume-control-vertical {
    background: rgba(255, 255, 255, 0.03);
}

.volume-control-vertical svg {
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.volume-control-vertical input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    flex: 1;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--volume-percent, 50%), rgba(255, 255, 255, 0.25) var(--volume-percent, 50%), rgba(255, 255, 255, 0.25) 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

body.dark-theme .volume-control-vertical input[type="range"] {
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--volume-percent, 50%), rgba(200, 200, 216, 0.15) var(--volume-percent, 50%), rgba(200, 200, 216, 0.15) 100%);
}

.volume-control-vertical input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-control-vertical input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 2px 6px var(--shadow);
}

body.dark-theme .volume-control-vertical input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 2px 6px var(--shadow);
}

.volume-control-vertical input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-control-vertical input[type="range"]::-moz-range-thumb:hover {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 2px 6px var(--shadow);
}

body.dark-theme .volume-control-vertical input[type="range"]::-moz-range-thumb:hover {
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 2px 6px var(--shadow);
}

.volume-percentage {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 38px;
    text-align: right;
}

.player-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 40px;
    touch-action: manipulation;
}

body.dark-theme .action-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 200, 216, 0.12);
}

body.can-hover .action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme.can-hover .action-btn:hover {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.08);
}

.action-btn:active {
    transform: scale(0.92) !important;
    background: rgba(255, 107, 53, 0.4) !important;
    transition: none !important;
}

body.dark-theme .action-btn:active {
    background: rgba(200, 200, 216, 0.3) !important;
}

.action-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme .action-btn.active {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.action-btn span {
    display: none;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.back-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px !important;
}
.back-btn:hover {
    background: rgba(120, 120, 120, 0.1) !important;
}

.time-current, .time-total {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 35px;
    font-weight: 600;
}

.time-total {
    text-align: right;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    position: relative;
    overflow: visible;
    cursor: pointer;
}

body.dark-theme .progress-bar {
    background: rgba(200, 200, 216, 0.15);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.1s linear;
    width: 0%;
    pointer-events: none;
}

.progress-slider {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 18px;
    background: transparent;
    cursor: pointer;
    outline: none;
    z-index: 10;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 3px 10px var(--shadow);
}

body.dark-theme .progress-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 3px 10px var(--shadow);
}

.progress-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.progress-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 3px 10px var(--shadow);
}

body.dark-theme .progress-slider::-moz-range-thumb:hover {
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 3px 10px var(--shadow);
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}

body.dark-theme .control-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 200, 216, 0.12);
}

.control-btn.small-btn {
    min-width: 40px;
}

body.can-hover .control-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme.can-hover .control-btn:hover {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.08);
}

.control-btn:active {
    transform: scale(0.92) !important;
    background: rgba(255, 107, 53, 0.4) !important;
    transition: none !important;
}

body.dark-theme .control-btn:active {
    background: rgba(200, 200, 216, 0.3) !important;
}

.control-btn.play-btn {
    min-width: 56px;
    min-height: 56px;
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--shadow);
}

body.dark-theme .control-btn.play-btn {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
}

body.can-hover .control-btn.play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 6px 20px var(--shadow);
}

body.dark-theme.can-hover .control-btn.play-btn:hover {
    background: rgba(200, 200, 216, 0.25);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1), 0 6px 20px var(--shadow);
}

.control-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme .control-btn.active {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1);
}

.queue-section {
    display: none;
}

.queue-bottom-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    bottom: env(safe-area-inset-bottom, 0);
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 90;
    min-height: 60px;
    box-shadow: 0 -2px 16px var(--shadow);
}

body.dark-theme .queue-bottom-bar {
    border-top-color: rgba(200, 200, 216, 0.1);
    background: rgba(20, 20, 30, 0.85);
}

.queue-bottom-bar.hidden {
    transform: translateY(100%);
}

.queue-bar-handle {
    width: 36px;
    height: 4px;
    background: var(--text-secondary);
    opacity: 0.3;
    border-radius: 2px;
    margin: 0 auto 8px;
}

.queue-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.queue-bar-text h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.queue-bar-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.queue-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    max-height: calc(70vh - env(safe-area-inset-bottom));
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 24px var(--shadow);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2005;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
}

body.dark-theme .queue-drawer {
    border-top-color: rgba(200, 200, 216, 0.1);
    background: rgba(12, 12, 18, 0.95);
}

.queue-drawer.active {
    transform: translateY(0);
}

.queue-drawer-handle {
    padding: 10px;
    display: flex;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.queue-drawer-handle::before {
    content: '';
    width: 36px;
    height: 4px;
    background: var(--text-secondary);
    opacity: 0.4;
    border-radius: 2px;
}

.queue-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 14px;
    -webkit-overflow-scrolling: touch;
}

.queue-drawer-content::-webkit-scrollbar {
    width: 4px;
}

.queue-drawer-content::-webkit-scrollbar-track {
    background: transparent;
}

.queue-drawer-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.queue-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.queue-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.queue-header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 700;
}

.clear-queue-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.clear-queue-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme .clear-queue-btn:hover {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1);
}

.queue-list-drag {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-queue {
    text-align: center;
    color: var(--text-secondary);
    padding: 28px 14px;
    font-size: 0.85rem;
}

.queue-item-drag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: grab;
    transition: all 0.3s ease;
}

body.dark-theme .queue-item-drag {
    background: rgba(255, 255, 255, 0.03);
}

.queue-item-drag:hover {
    background: rgba(255, 107, 53, 0.12);
    transform: translateX(3px);
}

body.dark-theme .queue-item-drag:hover {
    background: rgba(200, 200, 216, 0.08);
}

.queue-item-drag:active {
    cursor: grabbing;
}

.queue-drag-handle {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    cursor: grab;
    flex-shrink: 0;
}

.queue-item-thumbnail {
    width: 44px;
    height: 44px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-theme .queue-item-thumbnail {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.queue-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.queue-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-channel {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 32px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.queue-item-remove:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    transform: scale(1.1);
}

.side-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 380px;
    max-width: 90%;
    height: 100vh;
    height: -webkit-fill-available;
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.dark-theme .side-menu {
    background: rgba(12, 12, 18, 0.95);
}

.side-menu.active {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    padding-top: max(18px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.menu-header h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.close-menu {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    touch-action: manipulation;
}

.close-menu:hover {
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent);
    transform: rotate(90deg);
}

body.dark-theme .close-menu:hover {
    background: rgba(200, 200, 216, 0.12);
}

.menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

.menu-content::-webkit-scrollbar {
    width: 4px;
}

.menu-content::-webkit-scrollbar-track {
    background: transparent;
}

.menu-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin: 0;
    border-bottom: 1px solid var(--divider);
}


.menu-item span {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-mini {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2); /* darkened to prevent blending */
    border: 1px solid rgba(0, 0, 0, 0.15); /* subtle border for contrast */
    transition: 0.4s;
    border-radius: 30px;
}

body.dark-theme .slider-mini {
    background: rgba(200, 200, 216, 0.2);
}

.slider-mini:before {
    position: absolute;
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: white;
    transition: 0.4s;
}

body.dark-theme .slider-mini:before {
    background-color: var(--text-primary);
}

input:checked + .slider-mini {
    background-color: #FF6B35; /* active color in light theme */
}

/* Dark theme active color for the toggle */
body.dark-theme input:checked + .slider-mini {
    background-color: #888888; /* grey when active in dark mode */
}

input:checked + .slider-mini:before {
    transform: translateX(22px); /* moves 22px to the right — matches knob width */
}

/* Make room action buttons narrower and centered */
.room-action-buttons .btn-primary,
.room-action-buttons .btn-secondary {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

/* Theme section top spacing */
.menu-item + .menu-section,
.auth-section + .menu-section {
    margin-top: 0px;
}

.menu-section {
    margin-bottom: 0px;
}

.menu-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    /* unified spacing to match Favorites section */
    margin-bottom: 10px; /* same as favorites */
    padding-bottom: 6px; /* same as favorites */
    border-bottom: 1px solid var(--divider);
}

.no-room-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

.room-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

body.dark-theme .btn-primary {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

body.dark-theme .btn-primary:hover {
    background: rgba(200, 200, 216, 0.25);
    box-shadow: 0 0 0 3px rgba(200, 200, 216, 0.1);
}

.btn-secondary {
    /* Darken secondary (Join Room) button to prevent blending */
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    border: 1.5px solid rgba(0, 0, 0, 0.2);
}

body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(200, 200, 216, 0.12);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.25);
}

body.dark-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.join-room-state {
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

body.dark-theme .join-room-state {
    background: rgba(255, 255, 255, 0.03);
}

.state-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.room-code-input-wrapper {
    display: flex;
    gap: 7px;
    margin-bottom: 10px;
}

#joinRoomCodeInput {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.3s ease;
}

body.dark-theme #joinRoomCodeInput {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 200, 216, 0.12);
}

#joinRoomCodeInput:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.06);
}

body.dark-theme #joinRoomCodeInput:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.btn-icon-only {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

body.dark-theme .btn-icon-only {
    background: rgba(200, 200, 216, 0.2);
    color: var(--text-primary);
}

.btn-icon-only:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

body.dark-theme .btn-icon-only:hover {
    background: rgba(200, 200, 216, 0.25);
}

.btn-text {
    width: 100%;
    padding: 9px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-text:hover {
    color: var(--accent);
}

.room-info-menu {
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

body.dark-theme .room-info-menu {
    background: rgba(255, 255, 255, 0.03);
}

.room-code-display {
    margin-bottom: 14px;
}

.code-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9px;
}

body.dark-theme .code-box {
    background: rgba(255, 255, 255, 0.04);
}

.code-value {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
}

.copy-code-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 7px;
    transition: all 0.3s ease;
    min-width: 32px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.copy-code-btn:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent);
}

body.dark-theme .copy-code-btn:hover {
    background: rgba(200, 200, 216, 0.12);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--divider);
}

.info-row span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-row strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.host-controls {
    margin-top: 4px;
    padding-top: 10px;
}

.control-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.control-toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.control-toggle span {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.btn-danger {
    width: 100%;
    margin-top: 14px;
    padding: 11px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    touch-action: manipulation;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
}

.favorites-list, .history-list, .downloads-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Slightly larger gap for better separation */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.favorites-list::-webkit-scrollbar {
    width: 4px;
}

.favorites-list::-webkit-scrollbar-track {
    background: transparent;
}

.favorites-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.no-favorites {
    text-align: center;
    color: var(--text-secondary);
    padding: 28px 18px;
    font-size: 0.85rem;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

body.dark-theme .favorite-item {
    background: rgba(255, 255, 255, 0.03);
}

.favorite-item:hover {
    background: rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateX(3px);
}

body.dark-theme .favorite-item:hover {
    background: rgba(200, 200, 216, 0.08);
    border-color: rgba(200, 200, 216, 0.2);
}

.favorite-item-thumbnail {
    width: 44px;
    height: 44px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.dark-theme .favorite-item-thumbnail {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.favorite-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.favorite-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-item-channel {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.favorite-item-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: 32px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.favorite-item-btn:hover {
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent);
    transform: scale(1.1);
}

body.dark-theme .favorite-item-btn:hover {
    background: rgba(200, 200, 216, 0.12);
}

.favorite-item-btn.remove:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.favorite-item-btn svg {
    width: 15px;
    height: 15px;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Overlays and Settings Modals */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    animation: fadeIn 0.25s forwards;
}
.settings-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    z-index: 9999;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
    opacity: 0;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: none;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
.modal-body {
    padding: 20px;
}
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.radio-item {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.2s;
}
.radio-item:hover {
    background: rgba(120, 120, 120, 0.1);
}
.radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}
.radio-content {
    display: flex;
    flex-direction: column;
}
.radio-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}
.radio-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

@keyframes modalPop {
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .settings-modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: none;
        border-radius: 24px 24px 0 0;
        border: none;
        border-top: 1px solid var(--border);
        animation: slideUpModal 0.3s forwards;
    }
    @keyframes slideUpModal {
        to { transform: translateY(0); opacity: 1; }
    }
}

.song-options-menu {
    position: absolute;
    /* position near the clicked element; top/left set dynamically in JS */
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 14px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px;
    z-index: 1002;
    min-width: 200px;
    max-width: 90vw;
    animation: slideUp 0.3s ease;
}

body.dark-theme .song-options-menu {
    border-color: rgba(200, 200, 216, 0.1);
    background: rgba(12, 12, 18, 0.95);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 34px;
    touch-action: manipulation;
}

.option-item:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent);
}

body.dark-theme .option-item:hover {
    background: rgba(200, 200, 216, 0.08);
}

.option-item svg {
    flex-shrink: 0;
}

.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    color: var(--text-primary);
    padding: 11px 18px;
    border-radius: 40px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.dark-theme .toast {
    border-color: rgba(200, 200, 216, 0.1);
    background: rgba(12, 12, 18, 0.95);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.blur-background {
    filter: blur(8px);
    pointer-events: none;
}

.no-scroll {
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (prefers-contrast: high) {
    :root {
        --bg-primary: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
        --bg-glass: rgba(255, 250, 245, 1);
        --shadow: rgba(0, 0, 0, 0.5);
    }

    body.dark-theme {
        --bg-primary: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
        --bg-glass: rgba(0, 0, 0, 1);
        --text-primary: #ffffff;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 1023px) {
    .logo {
        display: flex;
        flex: 1;
        transition: opacity 0.3s ease;
        min-height: 44px;
    }
    
    .top-bar.search-active .logo,
    .top-bar:has(.search-container:focus-within) .logo,
    .top-bar:has(.search-popup[style*="display: block"]) .logo {
        opacity: 0;
        pointer-events: none;
    }



    .search-container {
        flex: 0 0 44px;
        width: 44px;
        padding: 0;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.dark-theme .search-container {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }
    
    #searchInput {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        opacity: 0.01;
        padding: 0;
        color: transparent;
        cursor: pointer;
        z-index: 5;
    }
    
    .top-bar {
        gap: 0;
    }

    .ghost-search-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        color: white;
    }
    
    .top-bar:not(.search-active) .clear-search-btn {
        display: none !important;
    }
    
    .top-bar.search-active .search-container,
    .top-bar:has(.search-popup[style*="display: block"]) .search-container,
    .top-bar .search-container:focus-within {
        position: absolute;
        left: 16px;
        right: 16px;
        flex: 1;
        width: auto;
        padding: 0 16px 0 4px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 10;
        justify-content: flex-start;
    }
    
    body.dark-theme .top-bar.search-active .search-container,
    body.dark-theme .top-bar .search-container:focus-within {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .top-bar.search-active #searchInput,
    .top-bar:has(.search-popup[style*="display: block"]) #searchInput,
    .top-bar .search-container:focus-within #searchInput {
        position: relative;
        width: 100%;
        height: auto;
        opacity: 1;
        color: var(--text-primary);
        cursor: text;
        z-index: 1;
    }
    
    .top-bar.search-active .ghost-search-btn,
    .top-bar:has(.search-popup[style*="display: block"]) .ghost-search-btn,
    .top-bar .search-container:focus-within .ghost-search-btn {
        color: var(--accent);
    }
    
    body.dark-theme .top-bar.search-active .ghost-search-btn,
    body.dark-theme .top-bar .search-container:focus-within .ghost-search-btn {
        color: #ffffff;
    }
    
    .player-thumbnail {
        max-width: 200px;
    }
}

@media (max-width: 380px) {
    .player-thumbnail {
        max-width: 180px !important;
    }
    
    .player-info h3 {
        font-size: 0.9rem;
    }
    
    .action-btn {
        min-width: 36px;
        min-height: 36px;
    }
    
    .control-btn.play-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .player-card {
        padding: 9px;
    }
}

@media (max-width: 1023px) and (orientation: landscape) {
    .player-thumbnail {
        max-width: 150px !important;
    }
    
    .player-card {
        flex-direction: row;
        gap: 10px;
    }
    
    .player-media-container {
        flex: 0 0 auto;
    }
    
    .controls-wrapper {
        flex: 1;
        margin-top: 0;
    }
}

@media (min-width: 1024px) {
    .logo {
        display: flex;
    }

    .main-content-wrapper {
        flex-direction: row;
        display: grid;
        grid-template-columns: 320px 1fr 320px;
        gap: 20px;
        padding-bottom: 0;
        overflow-y: hidden; /* Prevent body scroll, let columns scroll */
    }

    .explore-section, .view-section {
        grid-column: 2 / 3;
        overflow-y: auto;
        height: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .queue-section {
        display: flex;
        flex-direction: column;
        background: var(--bg-glass);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        border-radius: 16px;
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        overflow: hidden;
    }

    body.dark-theme .queue-section {
        border-color: rgba(200, 200, 216, 0.1);
        background: rgba(20, 20, 30, 0.65);
    }

    .queue-section .queue-list-drag {
        flex: 1;
        overflow-y: auto;
        padding-right: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .queue-section .queue-list-drag::-webkit-scrollbar {
        width: 4px;
    }

    .queue-section .queue-list-drag::-webkit-scrollbar-track {
        background: transparent;
    }

    .queue-section .queue-list-drag::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 2px;
    }

    .queue-bottom-bar {
        display: none;
    }

    .queue-drawer:not(#playlistDrawer) {
        display: none;
    }

    .player-card {
        justify-content: space-between;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .player-thumbnail {
        max-width: 260px;
    }

    .player-info h3 {
        font-size: 1.05rem;
    }

    .controls-wrapper {
        margin-top: 0;
    }

    .player-media-container {
        margin-bottom: 8px;
    }

    .player-info {
        margin-bottom: 8px;
    }
}

@media (min-width: 1000px) and (max-width: 1030px) and (min-height: 590px) and (max-height: 610px) {
    .queue-section {
        max-height: calc(100vh - 70px);
    }
    
    .queue-section .queue-list-drag {
        max-height: calc(100vh - 180px);
        overflow-y: auto !important;
    }
    
    .player-thumbnail {
        max-width: 200px !important;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 8px;
    }

    .top-bar {
        padding: 6px 12px;
        margin-bottom: 6px;
    }

    .logo h1 {
        line-height: 1;
        transform: translateY(-1px);
    }

    .player-card {
        padding: 14px;
    }

    .player-thumbnail {
        max-width: 280px;
    }
}

@media (min-width: 1280px) {
    .player-thumbnail {
        max-width: 300px;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1380px;
        padding: 10px;
    }

    .main-content-wrapper {
        gap: 8px;
    }

    .player-thumbnail {
        max-width: 320px;
    }

    .player-card {
        padding: 16px;
    }

    .queue-section {
        padding: 16px;
    }
}

@media (min-width: 1600px) {
    .player-thumbnail {
        max-width: 340px;
    }
}

@media (min-width: 1024px) and (max-height: 900px) {
    .player-thumbnail {
        max-width: 240px;
    }
}

@media (min-width: 1024px) and (max-height: 800px) {
    .player-thumbnail {
        max-width: 220px;
    }

    .player-info h3 {
        font-size: 0.95rem;
    }

    .player-info {
        margin-bottom: 6px;
    }

    .player-media-container {
        margin-bottom: 6px;
    }
}

@media (min-width: 1024px) and (max-height: 700px) {
    .player-thumbnail {
        max-width: 180px;
    }

    .player-info h3 {
        font-size: 0.9rem;
    }
}
/* Add to your styles.css */
.search-popup {
    position: absolute;
    top: calc(100% + 8px); /* Increased spacing */
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 16px;
    box-shadow: 0 12px 40px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    max-height: 380px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    padding: 8px;
    margin-top: 4px; /* Extra margin */
}

/* Fix for mobile search container */
@media (max-width: 768px) {
    .search-popup {
        max-height: 60vh;
        top: calc(100% + 6px);
    }
    
    .top-bar {
        position: relative;
        z-index: 100;
    }
}

.option-item.disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
    color: var(--text-secondary);
}

/* --- Playlist Feature Styles --- */

.playlists-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.playlists-list::-webkit-scrollbar { width: 4px; }
.playlists-list::-webkit-scrollbar-track { background: transparent; }
.playlists-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-theme .playlist-item {
    background: rgba(255, 255, 255, 0.03);
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(4px);
}

body.dark-theme .playlist-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.playlist-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.playlist-item-info svg {
    color: var(--accent);
    flex-shrink: 0;
}

.playlist-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.playlist-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.playlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.playlist-modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 100%;
    max-width: 340px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-theme .playlist-modal-content {
    border-color: rgba(200, 200, 216, 0.1);
}

.playlist-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.playlist-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.create-new-playlist-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.create-new-playlist-btn:hover {
    background: rgba(255, 107, 53, 0.1);
}

.modal-playlists-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
}

.playlist-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.3s ease;
}

body.dark-theme .playlist-input {
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.playlist-input:focus {
    border-color: var(--accent);
}

.playlist-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.playlist-viewer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.playlist-viewer-list::-webkit-scrollbar {
    width: 4px;
}

.playlist-viewer-list::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-viewer-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.queue-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 12px;
}

.queue-drawer-header .playlist-info {
    display: flex;
    flex-direction: column;
}

.playlist-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
@keyframes spin { 100% { transform: rotate(360deg); } }

input, textarea { -webkit-user-select: text; user-select: text; }

/* Accordion Header Styling */
.accordion-header h3,
.accordion-header .section-icon {
    transition: all 0.3s ease;
}

body.dark-theme .accordion-header:not(.active) h3 {
    color: var(--text-secondary);
}
body.dark-theme .accordion-header:not(.active) .section-icon {
    stroke: var(--text-secondary);
}

/* Active State - Light Theme */
.accordion-header.active h3 {
    color: var(--accent);
    font-weight: 700;
}
.accordion-header.active .section-icon {
    stroke: var(--accent);
}

/* Active State - Dark Theme */
body.dark-theme .accordion-header.active h3 {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
body.dark-theme .accordion-header.active .section-icon {
    stroke: #ffffff;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.15));
}

.accordion-content {
    padding-top: 12px;
}

/* ==================== EXPLORE SECTION ==================== */
.explore-section {
    width: 100%;
    margin-bottom: 24px;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 0 4px;
}

.explore-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-theme .explore-title {
    background: linear-gradient(135deg, #ffffff 0%, #b3b3b3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.explore-row-container {
    margin-bottom: 28px;
}

.explore-row-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px 4px;
    color: var(--text-primary);
}

.explore-scroll-row {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 4px;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.explore-scroll-row::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.explore-item {
    flex: 0 0 140px;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    border-radius: 12px;
}

.explore-item:hover {
    transform: translateY(-4px);
}

.explore-item-img-wrap {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    background-color: rgba(0,0,0,0.05);
}

body.dark-theme .explore-item-img-wrap {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background-color: rgba(255,255,255,0.05);
}

.explore-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.explore-item:hover .explore-item-img {
    transform: scale(1.05);
}

.explore-item-info {
    padding: 0 2px;
    width: 100%;
}

.explore-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explore-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explore-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.explore-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

body.dark-theme .explore-loading .spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: var(--accent);
}

@media (max-width: 480px) {
    .explore-item {
        flex: 0 0 120px;
        min-width: 0;
    }
    .explore-item-img-wrap {
        width: 120px;
        height: 120px;
    }
}

/* --- Redesign: Bottom Nav & View Sections --- */

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--divider);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

body.dark-theme .bottom-nav {
    background: rgba(20, 20, 30, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.nav-item svg {
    transition: transform 0.2s ease, stroke-width 0.2s ease;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active svg {
    stroke-width: 2.5px;
    transform: translateY(-2px);
}

/* View Sections (Profile, Favorites, etc.) */
.view-section {
    padding: 0;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.view-header {
    flex-shrink: 0;
    width: 100%;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: transparent;
}

body.dark-theme .view-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.view-header h2, .view-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.view-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px 18px;
    min-height: 0;
}

/* Profile section has no view-header so it gets its own padding */
#profileSection {
    padding: 16px 18px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Adjustments */
@media (max-width: 1023px) {
    .main-content-wrapper {
        position: static !important;
        z-index: auto !important;
        padding-bottom: 0 !important;
    }

    .explore-section, .view-section {
        padding-bottom: 0 !important;
    }

    .view-content, #profileSection {
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }

    .explore-section {
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }

    body.player-active .view-content,
    body.player-active .explore-section,
    body.player-active #profileSection {
        padding-bottom: calc(160px + env(safe-area-inset-bottom)) !important;
    }

    /* Show bottom queue bar only on the full player screen */
    .queue-bottom-bar {
        display: none !important;
    }
    
    body.player-active .queue-bottom-bar {
        display: flex !important;
        z-index: 2001 !important;
    }

    body.player-active .bottom-nav {
        display: none !important;
    }

    /* Style Player Card as fixed slide-up overlay on mobile */
    .player-card {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2000 !important;
        background: var(--bg-secondary) !important;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 0 !important;
        border: none !important;
        padding: 20px !important;
        padding-top: max(20px, env(safe-area-inset-top)) !important;
        padding-bottom: calc(max(20px, env(safe-area-inset-bottom)) + 65px) !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: none !important;
    }

    .player-card.active {
        transform: translateY(0) !important;
    }

    /* Player Minimize Button (Mobile only) */
    .player-minimize-btn {
        display: block !important;
        background: rgba(0, 0, 0, 0.15);
        border: none;
        width: 48px;
        height: 5px;
        border-radius: 3px;
        color: transparent;
        cursor: pointer;
        margin-bottom: 20px;
        align-self: center;
        transition: background 0.2s ease, transform 0.2s ease;
        flex-shrink: 0;
    }
    
    .player-minimize-btn svg {
        display: none !important;
    }

    body.dark-theme .player-minimize-btn {
        background: rgba(255, 255, 255, 0.2);
    }

    .player-minimize-btn:active {
        transform: scale(0.95);
        background: rgba(0, 0, 0, 0.25);
    }

    body.dark-theme .player-minimize-btn:active {
        background: rgba(255, 255, 255, 0.3);
    }

    /* Mobile Queue Button inside player card actions */
    #openQueueBtnMobile { display: none !important; }
    
    /* Spacing fixes for other player elements on mobile to fit nicely */
    .player-media-container {
        margin-bottom: 12px !important;
    }
    
    .player-thumbnail {
        max-width: 210px !important;
    }
}

/* --- Mini Player --- */
.mini-player {
    display: none;
}

.player-minimize-btn {
    display: none;
}

#openQueueBtnMobile {
    display: none;
}

@media (max-width: 1023px) {
    .mini-player {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        bottom: 72px; /* Sits exactly above the bottom-nav */
        bottom: calc(72px + env(safe-area-inset-bottom));
        left: 12px;
        right: 12px;
        height: 64px;
        background: var(--bg-glass);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        padding: 0 16px;
        z-index: 999;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    body.dark-theme .mini-player {
        background: rgba(20, 20, 30, 0.9);
        border-color: rgba(255, 255, 255, 0.05);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .mini-player:active {
        transform: scale(0.98);
    }
    
    .mini-player-info {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        min-width: 0;
    }
    
    .mini-player-thumbnail-wrap {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        overflow: hidden;
        background: linear-gradient(135deg, var(--accent), #FDC830);
        flex-shrink: 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .mini-player-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .mini-player-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    
    #miniPlayerTitle {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #miniPlayerArtist {
        font-size: 0.75rem;
        color: var(--text-secondary);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mini-player-controls {
        display: flex;
        align-items: center;
        gap: 16px;
        flex-shrink: 0;
    }
    
    .mini-control-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s;
    }
    
    body.dark-theme .mini-control-btn {
        color: #ffffff;
    }
    
    .mini-control-btn:active {
        transform: scale(0.9);
    }
}

/* Desktop Adjustments for Redesign */
@media (min-width: 1024px) {
    .bottom-nav {
        display: none !important; /* Hide bottom nav on desktop */
    }
    
    #profileBtnDesktop {
        display: none !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 6px;
        border-radius: 50%;
        transition: background 0.2s ease;
    }
    
    #profileBtnDesktop:hover {
        background: rgba(0,0,0,0.05);
    }
    
    body.dark-theme #profileBtnDesktop:hover {
        background: rgba(255,255,255,0.1);
    }
}

/* ==========================================================================
   Premium Glassmorphic Splash Screen
   ========================================================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    overflow: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
    visibility: visible;
    opacity: 1;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Dynamic Ambient Glow behind the card */
.splash-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.4) 0%, rgba(247, 147, 30, 0.2) 50%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: glowPulse 6s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

body.dark-theme .splash-glow {
    background: radial-gradient(circle, rgba(255, 107, 53, 0.25) 0%, rgba(247, 147, 30, 0.1) 50%, rgba(0, 0, 0, 0) 70%);
}

@keyframes glowPulse {
    0% {
        transform: scale(0.9) translate(-5%, -5%);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.1) translate(5%, 5%);
        opacity: 1.2;
    }
}

/* Glassmorphic Card */
.splash-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    padding: 40px 30px;
    width: 90%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 2;
    text-align: center;
    transform: translateY(0);
    animation: floatCard 4s ease-in-out infinite alternate;
}

body.dark-theme .splash-card {
    background: rgba(20, 20, 30, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

@keyframes floatCard {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-8px); }
}

/* Vinyl Spinner */
.splash-vinyl-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 25px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    perspective: 800px;
}

.splash-vinyl {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #222 15%, #050505 16%, #1a1a1a 30%, #0c0c0c 45%, #181818 60%, #050505 70%);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #111;
    animation: spin 5s linear infinite;
}

/* Grooves on vinyl */
.vinyl-groove {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}
.groove-1 { width: 85%; height: 85%; }
.groove-2 { width: 65%; height: 65%; }
.groove-3 { width: 45%; height: 45%; }

.vinyl-center {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.splash-logo {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)) ;
    animation: pulseLogo 2s ease-in-out infinite alternate;
}

/* Vinyl Reflection Shine Overlay */
.splash-vinyl-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseLogo {
    0% { transform: scale(0.95); }
    100% { transform: scale(1.08); }
}

/* 5-Bar Equalizer */
.splash-equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 25px;
    margin-bottom: 20px;
}

.eq-bar {
    width: 4px;
    height: 4px;
    background: linear-gradient(to top, #FF6B35, #F7931E);
    border-radius: 2px;
    animation: bounce 1.2s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) { animation-delay: 0.1s; animation-duration: 0.8s; }
.eq-bar:nth-child(2) { animation-delay: 0.3s; animation-duration: 1.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.0s; animation-duration: 0.9s; }
.eq-bar:nth-child(4) { animation-delay: 0.4s; animation-duration: 1.2s; }
.eq-bar:nth-child(5) { animation-delay: 0.2s; animation-duration: 1.0s; }

@keyframes bounce {
    0% { height: 4px; }
    100% { height: 25px; }
}

/* Typography & Titles */
.splash-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.splash-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-weight: 500;
    height: 1.2em; /* fixed height to avoid layout shift when status changes */
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

body.dark-theme .splash-subtitle {
    color: #a0a0b0;
}

/* Simulated Progress Bar */
.splash-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

body.dark-theme .splash-progress-track {
    background: rgba(255, 255, 255, 0.08);
}

.splash-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF6B35 0%, #F7931E 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

/* Container Hide/Fade-in */
.container {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.container.loaded {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Room Top Banner */
.room-top-banner {
    cursor: pointer;
    position: sticky;
    top: 10px;
    z-index: 50;
    margin: 10px 15px 15px 15px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.room-top-banner:active {
    transform: scale(0.98);
}

body.dark-theme .room-top-banner {
    background: rgba(40, 40, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
}

body.dark-theme .room-top-banner .pulse-dot {
    border: 2px solid rgba(40, 40, 50, 0.95) !important;
}

.room-top-banner .listener-pill {
    background: rgba(255, 107, 53, 0.1);
    color: #FF6B35;
}

body.dark-theme .room-top-banner .listener-pill {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Custom Toggle Switch for Room Options */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.4s;
    border-radius: 34px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.toggle-switch-input:checked + .toggle-slider {
    background-color: #22c55e;
}
.toggle-switch-input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* --- Profile Settings Styling --- */
.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 8px;
    font-weight: 700;
}

.settings-list {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-theme .settings-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover, .settings-item:active {
    background: rgba(255, 107, 53, 0.05);
}

body.dark-theme .settings-item:hover, body.dark-theme .settings-item:active {
    background: rgba(255, 255, 255, 0.03);
}

.settings-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    border-radius: 10px;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

body.dark-theme .settings-icon {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.settings-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.settings-chevron {
    color: var(--text-secondary);
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.settings-item:hover .settings-chevron {
    opacity: 1;
    transform: translateX(2px);
}

/* --- Profile Hero Card --- */
.profile-hero-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 28px 20px 20px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 60%, #FDC830 100%);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.35);
}

body.dark-theme .profile-hero-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.profile-hero-bg {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='80' cy='20' r='40' fill='rgba(255,255,255,0.06)'/%3E%3Ccircle cx='10' cy='80' r='30' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") no-repeat center/cover;
    pointer-events: none;
}

.profile-hero-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar-initials {
    color: white;
    opacity: 0.9;
}

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

.profile-hero-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-hero-email {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-auth-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-signin-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255,255,255,0.95) !important;
    color: #333 !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

body.dark-theme .profile-signin-btn {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

/* --- Profile Stats Row --- */
.profile-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.profile-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.profile-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--divider);
    opacity: 0.5;
}

@media (min-width: 1024px) {
    .container {
        padding-left: 210px !important;
        padding-right: 380px !important;
        padding-bottom: 0 !important;
        padding-top: 0 !important;
        max-width: none !important;
    }

    .desktop-sidebar {
        display: flex !important;
        position: fixed;
        left: 0;
        top: 0;
        width: 180px;
        bottom: 0;
        background: var(--bg-secondary);
        z-index: 100;
        border-right: 1px solid rgba(255,255,255,0.05);
        padding: 20px 0;
        flex-direction: column;
        overflow-y: auto;
    }
    body.dark-theme .desktop-sidebar {
        border-color: rgba(200, 200, 216, 0.05);
    }
    
    .sidebar-logo {
        padding: 0 24px 30px 24px;
        display: flex;
        align-items: center;
        gap: 16px;
    }
    
    .sidebar-logo h2 {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0;
    }
    
    .sidebar-logo svg {
        color: var(--accent);
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 12px;
    }
    
    .sidebar-nav .nav-item {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
        border-radius: 8px;
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 600;
        transition: all 0.2s;
    }
    
    .sidebar-nav .nav-item:hover {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary);
    }
    
    .sidebar-nav .nav-item.active {
        background: var(--accent-light);
        color: var(--accent);
    }

    .desktop-right-panel {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        right: 0;
        top: 0;
        width: 380px;
        height: 100vh;
        background: var(--bg-secondary);
        border-left: 1px solid rgba(255,255,255,0.05);
        z-index: 100;
        overflow: hidden;
    }
    body.dark-theme .desktop-right-panel {
        border-color: rgba(200, 200, 216, 0.05);
    }

    .player-card {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        width: 100% !important;
        height: 100vh !important;
        background: transparent !important;
        z-index: 2000 !important;
        padding: 24px 20px !important;
        align-items: center;
        justify-content: center !important;
        border-top: none !important;
        border-bottom: none !important;
        box-shadow: none;
        overflow: hidden !important;
    }
    
    .player-minimize-btn {
        display: none !important;
    }
    
    .player-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 16px !important;
    }
    
    .player-media-container {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 16px !important;
    }
    
    .player-thumbnail {
        width: 100% !important;
        height: 100% !important;
        max-width: 280px !important;
        max-height: 280px !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }
    
    .player-info {
        text-align: center !important;
        align-items: center !important;
        width: 100%;
        flex-shrink: 0;
        min-width: 0;
        padding: 0 10px;
    }
    
    .player-info h3 {
        font-size: 1.2rem !important;
        margin-bottom: 4px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .player-info p {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }
    
    .controls-wrapper {
        width: 100%;
        max-width: 100%;
        margin-top: auto !important;
        padding-bottom: 20px;
        flex-shrink: 0;
    }
    
    .player-controls {
        margin-bottom: 12px !important;
    }
    
    .player-actions {
        width: 100%;
        justify-content: center;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .action-btn {
        width: 32px !important;
        height: 32px !important;
    }
    
    .explore-section, .view-section {
        overflow-y: auto;
        height: 100%;
        padding-bottom: 20px !important;
    }
    
    .main-content-wrapper {
        display: block !important;
        height: 100%;
    }
    
    .top-bar {
        padding: 16px 24px !important;
    }
    
    .logo {
        display: none !important;
    }
    
    /* Queue Drawer Desktop Overrides */
    .queue-section {
        display: none !important;
    }
    .queue-bottom-bar {
        display: flex !important;
        position: fixed !important;
        right: 0 !important;
        left: auto !important;
        width: 380px !important;
        bottom: 0 !important;
        z-index: 2000 !important;
        border-radius: 0 !important;
    }
    .queue-drawer {
        position: fixed !important;
        right: 0 !important;
        left: auto !important;
        width: 380px !important;
        z-index: 2001 !important;
        display: flex !important;
    }
    .queue-drawer-overlay {
        right: 0 !important;
        left: auto !important;
        width: 380px !important;
        z-index: 2000 !important;
    }
    #openQueueBtnMobile { display: none !important; }
}





/* Desktop Wide - 4 Column Layout */
@media (min-width: 1280px) {
    .container {
        padding-right: 700px !important;
    }
    .desktop-right-panel {
        right: 320px !important;
        border-right: 1px solid rgba(255,255,255,0.05);
    }
    .queue-bottom-bar {
        display: none !important;
    }
    #queueDrawer {
        display: flex !important;
        position: fixed !important;
        right: 0 !important;
        left: auto !important;
        top: 0 !important;
        width: 320px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        flex-direction: column !important;
        transform: translateY(0) !important;
        border-radius: 0 !important;
        border-left: 1px solid rgba(255,255,255,0.05);
        z-index: 100 !important;
        background: var(--bg-secondary) !important;
        padding-bottom: 20px !important;
    }
    #queueDrawer .queue-drawer-handle, #queueDrawerOverlay {
        display: none !important;
    }
    #queueDrawer .queue-drawer-content {
        padding-top: 24px !important;
    }
}



body.dark-theme .settings-modal {
    background: #1e1e28 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8) !important;
}

/* Improve contrast for Listen Together section on light theme */
body:not(.dark-theme) .no-room-text {
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
}

body:not(.dark-theme) .room-action-buttons .btn-primary {
    background: #ffffff !important;
    color: var(--accent) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

body:not(.dark-theme) .room-action-buttons .btn-secondary {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-primary) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.15) !important;
}

.download-app-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    margin-left: 12px;
}

.download-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    background: #ff7a4a;
}

.download-app-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .download-app-btn span {
        display: none;
    }
    .download-app-btn {
        padding: 8px;
        border-radius: 50%;
    }
}

/* App Download Modal */
.app-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.app-modal-overlay.active {
    opacity: 1;
}

.app-modal {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 107, 53, 0.2);
}
.app-modal-overlay.active .app-modal {
    transform: scale(1);
}

body.dark-theme .app-modal {
    background: var(--bg-secondary);
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.close-modal-btn:hover {
    background: var(--divider);
    color: var(--text-primary);
}
body.dark-theme .close-modal-btn:hover {
    background: var(--divider);
}

.app-modal-header {
    text-align: center;
    margin-bottom: 32px;
}
.app-modal-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(255, 107, 53, 0.3);
}
.app-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.app-modal-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-modal-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.app-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
}
body.dark-theme .app-option-btn {
    background: rgba(255, 255, 255, 0.05);
}

.app-option-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.app-option-btn.android:hover {
    border-color: #3ddc84;
}
.app-option-btn.android svg {
    color: #3ddc84;
}

.app-option-btn.ios {
    opacity: 0.6;
    cursor: not-allowed;
}
.app-option-btn.ios svg {
    color: #000;
}
body.dark-theme .app-option-btn.ios svg {
    color: #fff;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.option-title {
    font-weight: 600;
    font-size: 1.05rem;
}
.option-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
