body {
    padding-bottom: 104px;
}

:root {
    scrollbar-color: #fff #050505;
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #050505;
}

*::-webkit-scrollbar-thumb {
    border: 3px solid #050505;
    border-radius: 6px;
    background: #fff;
}

*::-webkit-scrollbar-corner {
    background: #050505;
}

.global-player {
    position: fixed;
    inset: auto 0 0;
    z-index: 1100;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 10px 20px;
    border-top: 1px solid #444;
    background: #181818;
    color: #fff;
}

.global-player.hidden {
    display: none;
}

.global-player-cover {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    object-fit: cover;
}

.global-player-info {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
}

.global-player-title {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-player-album {
    display: none;
}

.global-player-artist {
    display: none;
}

.global-player-seek {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: #444;
    cursor: pointer;
}

.global-player-fill {
    width: 0;
    height: 100%;
    background: #1db954;
}

.global-player-time {
    color: #bbb;
    font-size: 11px;
    white-space: nowrap;
}

.global-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-button {
    display: inline-flex;
    min-width: 56px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #292929;
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

.player-button.player-expand,
.player-button.player-collapse {
    display: none;
}

.player-button:hover:not(:disabled) {
    background: #3a3a3a;
}

.player-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.player-button.active,
.player-button[aria-pressed="true"] {
    border-color: #1db954;
    color: #1ed760;
}

.player-play {
    border-color: #1db954;
    background: #1db954;
    color: #111;
}

.global-player-volume {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ddd;
    font-size: 11px;
    font-weight: bold;
}

.global-player-volume input {
    width: 88px;
    accent-color: #1db954;
}

.album-playlist {
    position: fixed;
    right: 18px;
    bottom: 96px;
    z-index: 1101;
    width: min(380px, calc(100vw - 24px));
    max-height: min(60vh, 520px);
    overflow: auto;
    border: 1px solid #555;
    border-radius: 6px;
    background: #202020;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    scrollbar-color: #fff #050505;
    scrollbar-width: thin;
}

.album-playlist[hidden] {
    display: none;
}

.album-playlist-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #444;
    background: #202020;
}

.playlist-back {
    flex: 0 0 auto;
}

.album-playlist-title {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-playlist-tracks {
    margin: 0;
    padding: 6px;
    list-style: none;
}

.playlist-track {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #eee;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}

.playlist-track:hover,
.playlist-track[aria-current="true"] {
    background: #343434;
    color: #1ed760;
}

@media (max-width: 720px) {
    body {
        padding-bottom: 84px;
    }

    .global-player {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        min-height: 76px;
        padding: 8px 16px;
        cursor: pointer;
    }

    .global-player-cover,
    .global-player-seek,
    .global-player-controls,
    .global-player-volume,
    .player-expand,
    .player-collapse {
        display: none;
    }

    .global-player-info {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 3px 12px;
    }

    .global-player-title {
        grid-column: 1;
        grid-row: 1;
        font-size: 16px;
    }

    .global-player-album {
        display: none;
    }

    .global-player-artist {
        display: block;
        grid-column: 1;
        grid-row: 2;
        overflow: hidden;
        color: #bbb;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .global-player-time {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        font-size: 12px;
    }

    .global-player-controls {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .global-player-volume {
        grid-column: 3;
        grid-row: 1;
    }

    .global-player-volume input {
        width: 64px;
    }

    .player-button {
        min-width: 72px;
        min-height: 42px;
    }

    .player-expand {
        display: inline-flex;
    }

    .album-playlist {
        right: 12px;
        bottom: 136px;
    }

    body.player-expanded {
        overflow: hidden;
        padding-bottom: 0;
    }

    .global-player.expanded {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto auto auto;
        align-content: stretch;
        gap: 16px;
        overflow: auto;
        padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
        border-top: 0;
    }

    .global-player.expanded .player-collapse {
        display: inline-flex;
        grid-column: 1;
        grid-row: 1;
        justify-self: end;
    }

    .global-player.expanded .global-player-cover {
        display: block;
        grid-column: 1;
        grid-row: 2;
        width: min(78vw, 35vh, 360px);
        height: min(78vw, 35vh, 360px);
        justify-self: center;
        align-self: center;
        border-radius: 8px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    }

    .global-player.expanded .global-player-info {
        grid-column: 1;
        grid-row: 3;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }

    .global-player.expanded .global-player-title {
        font-size: 20px;
        font-weight: bold;
    }

    .global-player.expanded .global-player-album {
        display: block;
        grid-column: 1 / -1;
        font-size: 14px;
    }

    .global-player.expanded .global-player-artist {
        display: none;
    }

    .global-player.expanded .global-player-seek {
        display: block;
        margin-top: 8px;
        height: 8px;
    }

    .global-player.expanded .global-player-time {
        font-size: 12px;
    }

    .global-player.expanded .global-player-controls {
        display: flex;
        grid-column: 1;
        grid-row: 4;
        flex-wrap: wrap;
        gap: 8px;
    }

    .global-player.expanded .player-button {
        min-width: 64px;
        min-height: 48px;
        padding: 0 8px;
        font-size: 12px;
    }

    .global-player.expanded .player-expand {
        display: none;
    }

    .global-player.expanded .global-player-volume {
        display: flex;
        grid-column: 1;
        grid-row: 5;
        justify-self: center;
        font-size: 13px;
    }

    .global-player.expanded .global-player-volume input {
        width: min(55vw, 240px);
    }

    body.player-expanded .album-playlist {
        z-index: 1201;
        inset: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
        width: auto;
        max-height: none;
        border-radius: 8px;
    }
}