@media (max-width: 390px) {
    :root {
        --player-height: 86px;
    }

    .volume-control {
        display: none;
    }

    .player-tools {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .queue-toggle-button,
    .timer-pill,
    .heart-button {
        width: 100%;
    }
}

@media (min-width: 1181px) and (max-width: 1600px) {
    .global-player {
        grid-template-columns: minmax(240px, 1fr) minmax(286px, auto) minmax(384px, 0.95fr);
        gap: 12px;
        min-height: 124px;
        padding: 16px 20px 18px;
    }

    .player-track {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 14px;
    }

    .track-cover {
        width: 78px;
    }

    .player-track-copy {
        gap: 5px;
    }

    .player-track h2 {
        font-size: 1.08rem;
    }

    .player-track p {
        font-size: 0.9rem;
    }

    .now-playing-badge {
        display: none;
    }

    .player-controls {
        min-width: 286px;
        gap: 10px;
    }

    .player-controls .icon-button {
        width: 42px;
        height: 42px;
    }

    .play-button {
        width: 66px;
        height: 66px;
    }

    .is-playing .play-symbol {
        width: 20px;
        height: 26px;
    }

    .player-tools {
        justify-content: end;
        gap: 8px;
        min-width: 0;
        padding-left: 0;
        border-left: 0;
    }

    .queue-toggle-button {
        width: 42px;
        min-width: 42px;
        padding: 0;
    }

    .queue-toggle-button > span:last-child {
        display: none;
    }

    .heart-button,
    .player-size-button {
        width: 42px;
        height: 42px;
    }

    .volume-control {
        grid-template-columns: auto minmax(76px, 112px);
        min-width: 120px;
    }

    .timer-pill {
        min-width: 82px;
        padding-inline: 11px;
    }

    .player-progress {
        gap: 10px;
    }
}

@media (max-width: 1180px) {
    :root {
        --player-height: 122px;
    }

    .global-player {
        bottom: 12px;
        grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
        grid-template-rows: auto auto;
        gap: 8px 14px;
        align-items: center;
        width: calc(100% - 28px);
        min-height: 0;
        padding: 12px 16px;
        border-radius: 16px;
    }

    .global-player::before {
        border-radius: 15px;
    }

    .player-track {
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 12px;
    }

    .track-cover {
        width: 62px;
        border-radius: 12px;
    }

    .player-track-copy {
        gap: 4px;
    }

    .player-track h2 {
        font-size: 1rem;
    }

    .player-track p {
        font-size: 0.86rem;
    }

    .now-playing-badge {
        display: none;
    }

    .player-controls {
        grid-column: 2;
        grid-row: 1;
        justify-content: center;
        gap: 8px;
    }

    .player-controls .icon-button {
        width: 40px;
        height: 40px;
    }

    .play-button {
        width: 56px;
        height: 56px;
    }

    .play-symbol {
        border-top-width: 10px;
        border-bottom-width: 10px;
        border-left-width: 15px;
    }

    .is-playing .play-symbol {
        width: 18px;
        height: 24px;
    }

    .player-tools {
        grid-column: 3;
        grid-row: 1;
        justify-content: end;
        gap: 8px;
        padding-left: 0;
        border-left: 0;
    }

    .queue-toggle-button,
    .timer-pill {
        min-height: 40px;
    }

    .queue-toggle-button {
        min-width: 94px;
        padding-inline: 12px;
    }

    .timer-pill {
        min-width: 78px;
        padding-inline: 11px;
    }

    .heart-button,
    .player-size-button {
        width: 40px;
        height: 40px;
    }

    .volume-control {
        grid-template-columns: auto minmax(70px, 94px);
        min-width: 126px;
    }

    .player-progress {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 10px;
        font-size: 0.82rem;
    }
}

@media (max-width: 820px) {
    :root {
        --player-height: 92px;
    }

    body:not(.player-is-compact) .global-player {
        bottom: 8px;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        align-content: start;
        gap: 10px;
        width: calc(100% - 16px);
        max-height: min(55vh, 520px);
        padding: 13px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body:not(.player-is-compact) .player-track,
    body:not(.player-is-compact) .player-controls,
    body:not(.player-is-compact) .player-tools,
    body:not(.player-is-compact) .player-progress,
    body:not(.player-is-compact) .player-notice {
        grid-column: 1;
        grid-row: auto;
    }

    body:not(.player-is-compact) .player-track {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    body:not(.player-is-compact) .track-cover {
        width: 58px;
    }

    body:not(.player-is-compact) .player-controls {
        justify-content: center;
    }

    body:not(.player-is-compact) .player-tools {
        justify-content: stretch;
        gap: 8px;
    }

    body:not(.player-is-compact) .queue-toggle-button,
    body:not(.player-is-compact) .timer-pill {
        min-width: 0;
        flex: 0 0 auto;
    }

    body:not(.player-is-compact) .volume-control {
        grid-template-columns: auto minmax(88px, 1fr);
        min-width: 0;
        flex: 1 1 auto;
    }

    body:not(.player-is-compact) .player-queue-panel,
    body:not(.player-is-compact) .player-save-panel {
        position: static;
        grid-column: 1;
        width: 100%;
        max-height: min(34vh, 320px);
        padding: 12px;
    }

    body:not(.player-is-compact) .player-queue-list {
        max-height: min(24vh, 230px);
    }

    body.player-is-compact {
        --player-height: 86px;
    }

    body.player-is-compact .global-player {
        bottom: 8px;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto;
        gap: 8px;
        width: calc(100% - 16px);
        min-height: 68px;
        padding: 8px 10px;
        border-radius: 16px;
    }

    body.player-is-compact .player-track {
        display: grid;
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 9px;
        align-items: center;
        min-width: 0;
    }

    body.player-is-compact .track-cover {
        display: block;
        width: 44px;
        border-radius: 11px;
    }

    body.player-is-compact .player-track-copy {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    body.player-is-compact .player-track h2 {
        font-size: 0.94rem;
        line-height: 1.15;
    }

    body.player-is-compact .player-track p {
        display: block;
        font-size: 0.76rem;
        line-height: 1.2;
    }

    body.player-is-compact .player-controls {
        grid-column: 2;
        grid-row: 1;
        gap: 7px;
    }

    body.player-is-compact .previous-button {
        display: none;
    }

    body.player-is-compact .player-controls .icon-button {
        width: 38px;
        height: 38px;
    }

    body.player-is-compact .play-button {
        width: 48px;
        height: 48px;
    }

    body.player-is-compact .player-tools {
        grid-column: 3;
        grid-row: 1;
        gap: 7px;
    }

    body.player-is-compact .heart-button {
        display: grid;
        width: 38px;
        height: 38px;
    }

    body.player-is-compact .player-size-button {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 520px) {
    :root {
        --player-height: 88px;
    }

    body.player-is-compact {
        --player-height: 82px;
    }

    body.player-is-compact .global-player {
        min-height: 64px;
        padding: 7px 9px;
    }

    body.player-is-compact .player-track {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
    }

    body.player-is-compact .track-cover {
        width: 42px;
    }

    body.player-is-compact .player-track p {
        display: none;
    }

    body.player-is-compact .play-button {
        width: 46px;
        height: 46px;
    }

    body.player-is-compact .heart-button,
    body.player-is-compact .player-size-button {
        width: 36px;
        height: 36px;
    }

    body:not(.player-is-compact) .global-player {
        max-height: min(55vh, 480px);
    }

    body:not(.player-is-compact) .volume-control {
        display: none;
    }

    body:not(.player-is-compact) .player-tools {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body:not(.player-is-compact) .queue-toggle-button,
    body:not(.player-is-compact) .timer-pill,
    body:not(.player-is-compact) .heart-button,
    body:not(.player-is-compact) .player-size-button {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .brand-logo {
        height: 42px;
        max-width: 118px;
    }

    .site-header {
        gap: 5px;
    }

    .nav-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .header-actions {
        gap: 5px;
    }

    .fair-use-chip {
        min-width: 76px;
        padding: 5px 6px;
    }

    .fair-use-chip strong {
        font-size: 0.74rem;
    }

    .fair-use-chip-meter {
        height: 4px;
    }

    .header-actions .ghost-link {
        min-height: 34px;
        max-width: 58px;
        padding-inline: 6px;
        font-size: 0.78rem;
    }

    .header-actions .button-small {
        min-height: 34px;
        padding-inline: 7px;
        font-size: 0.78rem;
    }
}

