/* SOUND WEB responsive controls and mobile layout */
.topbar-actions,
.welcome-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.welcome-actions .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.song-row.playing { background: rgba(167, 139, 250, 0.10); }
.song-row.playing .song-title { color: var(--accent); }

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 800px) {
    .topbar-actions { justify-content: flex-end; }
    .topbar-actions button { padding: 11px 13px; font-size: 12px; }
}

@media (max-width: 640px) {
    .sidebar { display: none; }
    .main-content { padding: 22px 15px 165px; }
    .topbar { align-items: flex-start; flex-direction: column; gap: 15px; }
    .topbar-actions { width: 100%; justify-content: stretch; }
    .topbar-actions button { flex: 1 1 145px; }
    .welcome-card { margin-top: 24px; padding: 23px 20px; min-height: 0; }
    .welcome-card h2 { font-size: 30px; }
    .welcome-actions { align-items: stretch; flex-direction: column; }
    .welcome-actions button { width: 100%; }
    .library-section { margin-top: 30px; }
    .song-header, .song-row { grid-template-columns: 24px minmax(0, 1fr) 42px; gap: 8px; }
    .song-header span:nth-child(3), .song-header span:nth-child(4),
    .song-row .song-type, .song-row .song-duration { display: none; }
    .player-bar {
        height: auto;
        min-height: 132px;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        padding: 9px 14px max(9px, env(safe-area-inset-bottom));
    }
    .now-playing { justify-content: center; gap: 10px; }
    .album-placeholder { width: 38px; height: 38px; font-size: 21px; }
    .player-controls { max-width: none; }
    .control-buttons { margin-bottom: 3px; gap: 23px; }
    .progress-container { gap: 8px; }
    .volume-control { display: none; }
}

@media (max-width: 380px) {
    .main-content { padding-left: 11px; padding-right: 11px; }
    .stat-card { padding: 14px; }
    .track-info strong { font-size: 12px; }
}

/* Adapt the composition to short landscape viewports and large displays. */
@media (min-width: 1440px) {
    .main-content {
        padding-left: clamp(48px, 5vw, 100px);
        padding-right: clamp(48px, 5vw, 100px);
    }

    .welcome-card {
        min-height: clamp(255px, 25vh, 390px);
    }

    .music-visual {
        font-size: clamp(180px, 16vw, 280px);
    }
}

@media (orientation: landscape) and (max-height: 560px) and (min-width: 641px) {
    .sidebar {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .brand {
        margin-bottom: 28px;
    }

    .main-content {
        padding-top: 16px;
        padding-bottom: 105px;
    }

    .welcome-card {
        min-height: 160px;
        margin-top: 20px;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .welcome-card h2 {
        font-size: 29px;
    }

    .welcome-card p {
        margin-bottom: 12px;
    }

    .library-section {
        margin-top: 22px;
    }

    .stats {
        margin-top: 14px;
        margin-bottom: 14px;
    }

    .player-bar {
        height: 82px;
        padding: 7px 18px;
        gap: 14px;
    }

    .album-placeholder {
        width: 42px;
        height: 42px;
    }

    .control-buttons {
        margin-bottom: 5px;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
    .sidebar {
        display: flex;
        width: 58px;
        padding: 14px 7px;
    }

    .brand {
        font-size: 0;
        justify-content: center;
        margin-bottom: 24px;
    }

    .nav-label,
    .nav-item,
    .sidebar-footer {
        font-size: 0;
        text-align: center;
        justify-content: center;
    }

    .main-content {
        padding: 12px 14px 96px;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        gap: 12px;
    }

    .topbar-actions button {
        padding: 8px 10px;
        font-size: 11px;
    }

    .welcome-card {
        min-height: 120px;
        margin-top: 14px;
        padding: 14px 18px;
    }

    .welcome-card h2 {
        font-size: 24px;
        margin: 6px 0;
    }

    .welcome-card p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .music-visual {
        display: none;
    }

    .library-section {
        margin-top: 16px;
    }

    .stats {
        margin: 10px 0;
    }

    .stat-card {
        min-width: 130px;
        padding: 10px;
    }

    .player-bar {
        height: 82px;
        min-height: 82px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
        padding: 6px 12px;
    }

    .volume-control {
        display: none;
    }
}
