:root {
    color-scheme: dark;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body, html { margin: 0; height: 100%; overflow: hidden; background: #05050a; color: #f6f6f8; }
canvas { display: block; width: 100%; height: 100%; }

#player {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 25;
    min-width: 280px;
    background: rgba(12, 12, 24, 0.82);
    border: 1px solid rgba(100, 100, 140, 0.35);
    padding: 14px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

#player-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

#playPause {
    width: 44px;
    height: 44px;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: #05050a;
    background: #9b7bff;
    transition: box-shadow 0.15s ease;
}

#playPause:hover {
    box-shadow: 0 6px 18px rgba(108, 132, 255, 0.35);
}

#playPause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#track-title {
    font-size: 15px;
    font-weight: 600;
    color: #f8f8ff;
    text-overflow: ellipsis;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
}

.time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #cfd1ff;
}

#progress {
    flex: 1;
    appearance: none;
    height: 4px;
    background: rgba(120, 120, 160, 0.35);
    outline: none;
    cursor: pointer;
}

#progress::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9b7bff;
    border: 2px solid #f8f8ff;
    box-shadow: 0 2px 6px rgba(60, 70, 120, 0.4);
}

#progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9b7bff;
    border: 1px solid #f8f8ff;
    box-shadow: 0 2px 6px rgba(60, 70, 120, 0.4);
}

#sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.source-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: #aeb3ff;
}
.source-row {
    display: flex;
    gap: 12px;
}

.source-row > * {
    flex: 1;
}

.source-group select,
.source-group label {
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(110, 110, 150, 0.35);
    background: rgba(35, 35, 55, 0.65);
    color: #f2f3ff;
    padding: 8px 11px;
    cursor: pointer;
}

.source-group select {
    appearance: none;
    width: 100%;
}

.upload-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    transition: box-shadow 0.15s ease;
}
.upload-label:hover {
    box-shadow: 0 6px 18px rgba(108, 132, 255, 0.35);
}

.upload-label.disabled {
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
    cursor: default;
}


#volume-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #c4c6ff;
}

#volume {
    flex: 1;
    accent-color: #9b7bff;
}

@media (max-width: 680px) {
    #player {
        position: fixed;
        top: 12px;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translateX(-50%);
        width: calc(100vw - 24px);
        max-width: 480px;
        min-width: 0;
        padding: 16px;
    }

    #player-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #playPause {
        width: 100%;
    }

    #track-info {
        align-items: stretch;
    }

    #track-title {
        max-width: none;
        text-align: center;
    }

    .time-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    #progress {
        width: 100%;
    }

    #sources {
        grid-template-columns: 1fr;
    }

    .source-row {
        flex-direction: column;
    }

    .source-row > * {
        flex: none;
    }

    #volume-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

#audio {
    display: none;
}

@media (max-width: 680px) {
    #player {
    max-width: calc(100% - 24px);
    }
    #sources {
    grid-template-columns: 1fr;
    }
}
