.music-view {
    /* Minimalist Frosted Glass Parameters */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
    --glass-glow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --glass-blur: blur(28px);

    /* Capsule Navigation Parameters */
    --nav-bg: rgba(15, 15, 15, 0.75);
    --nav-border: rgba(255, 255, 255, 0.06);

    /* Monochrome Color System */
    --text-main: rgba(255, 255, 255, 0.95);
    --text-sub: rgba(255, 255, 255, 0.5);
    --theme-accent: #ffffff;
    --bg-gradient: linear-gradient(145deg, #181818 0%, #0a0a0a 50%, #000000 100%);

    position: fixed;
    z-index: 1300;
    inset: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
}

.music-view[hidden] {
    display: none;
}

.music-view,
.music-view * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.music-view button,
.music-view input {
    color: inherit;
    font: inherit;
}

body.is-music-open .desktop-container,
body.is-music-open .pagination,
body.is-music-open .dock-container,
body.is-music-open .system-status-bar {
    visibility: hidden;
    pointer-events: none;
}

/* Ambient Glow - Pure Grayscale */
.music-view::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    animation: music-ambient-glow 10s ease-in-out infinite alternate;
}

@keyframes music-ambient-glow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.05) translate(1%, 1%); }
}

.music-view .glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-glow);
}

/* --- App Container --- */
.music-view .app-container {
    flex: 1;
    position: relative;
}

.music-view .page {
    position: absolute;
    inset: 0;
    padding: 20px 24px 180px 24px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.music-view .page.active {
    opacity: 1;
    pointer-events: auto;
}

.music-view .header-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 3px;
    margin: 10px 0 24px 0;
    color: var(--text-main);
    text-transform: uppercase;
}

.music-view .music-exit {
    position: fixed;
    z-index: 150;
    top: max(20px, env(safe-area-inset-top));
    left: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
}

.music-view .music-exit svg {
    width: 24px;
    height: 24px;
    fill: var(--text-main);
}

.music-view .section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 28px 0 16px 4px;
    letter-spacing: 1.5px;
    color: var(--text-main);
    text-transform: uppercase;
}

/* --- Horizontal Scroll Rows --- */
.music-view .scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px;
    margin-left: -4px;
    scrollbar-width: none;
}

.music-view .scroll-row::-webkit-scrollbar {
    display: none;
}

.music-view .playlist-card {
    min-width: 120px;
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
}

.music-view .playlist-card:active {
    transform: scale(0.96);
    transition: 0.2s;
}

.music-view .playlist-cover {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.music-view .playlist-title {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Vertical List Items --- */
.music-view .list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}

.music-view .list-item:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.08);
}

.music-view .item-cover {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2a2a2a, #111111);
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    font-size: 20px;
}

.music-view .item-info { flex: 1; }
.music-view .item-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.5px; }
.music-view .item-sub { font-size: 12px; color: var(--text-sub); font-weight: 400; }

/* --- Profile Elements --- */
.music-view .profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 10px;
}

.music-view .profile-avatar {
    width: 86px;
    height: 86px;
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* --- Bar Chart (Listening Activity) --- */
.music-view .chart-container {
    padding: 24px 20px 14px 20px;
    border-radius: 16px;
    margin-bottom: 28px;
}

.music-view .chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 90px;
}

.music-view .bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 10px;
    flex: 1;
}

.music-view .bar {
    width: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    transition: height 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.music-view .bar.active {
    background: var(--theme-accent);
    box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

.music-view .day { font-size: 10px; color: var(--text-sub); font-weight: 600; }

/* --- Capsule Bottom Navigation --- */
.music-view .bottom-nav {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 5%;
    right: 5%;
    width: 90%;
    height: 68px;
    border-radius: 34px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--nav-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.1);
    padding: 0 12px;
}

.music-view .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 600;
    gap: 6px;
    flex: 1;
    height: 100%;
    transition: 0.3s;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.music-view .nav-item.active { color: var(--text-main); }
.music-view .nav-item svg { width: 20px; height: 20px; fill: currentColor; transition: 0.3s; }
.music-view .nav-item.active svg { transform: translateY(-3px); filter: drop-shadow(0 4px 6px rgba(255,255,255,0.2)); }

/* --- Mini Player --- */
.music-view .mini-player {
    position: fixed;
    bottom: calc(max(24px, env(safe-area-inset-bottom)) + 68px + 16px);
    left: 5%;
    right: 5%;
    width: 90%;
    height: 64px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    padding: 0 16px 0 10px;
    z-index: 99;
    cursor: pointer;
}

.music-view .mini-cover {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a2a 30%, #000 100%);
    border: 2px solid rgba(255,255,255,0.1);
    margin-right: 14px;
    animation: music-spin 12s linear infinite;
    animation-play-state: paused;
}

.music-view .mini-cover.playing { animation-play-state: running; }
.music-view .mini-info { flex: 1; }
.music-view .mini-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.music-view .mini-btn svg { width: 20px; height: 20px; fill: var(--text-main); }

/* --- Search Input --- */
.music-view .search-box {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 24px;
    margin-bottom: 24px;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.music-view .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 15px;
}

.music-view .search-box input::placeholder { color: var(--text-sub); }

/* --- Full Screen Player --- */
.music-view .full-player {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px 24px 50px 24px;
}

.music-view .full-player.show { transform: translateY(0); }
.music-view .player-header { display: flex; align-items: center; margin-top: env(safe-area-inset-top); margin-bottom: 20px; }
.music-view .btn-down { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.music-view .btn-down svg { width: 24px; height: 24px; fill: var(--text-main); }
.music-view .player-title-box { flex: 1; text-align: center; }

.music-view .vinyl-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.music-view .tonearm {
    position: absolute;
    top: -10px;
    right: 15%;
    width: 100px;
    height: 160px;
    z-index: 10;
    transform-origin: 24px 24px;
    transform: rotate(-25deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-view .vinyl-wrapper.playing .tonearm { transform: rotate(5deg); }

.music-view .vinyl-record {
    width: 290px;
    height: 290px;
    border-radius: 50%;
    background: repeating-radial-gradient(#111 0%, #000 5%, #111 10%);
    border: 2px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: music-spin 15s linear infinite;
    animation-play-state: paused;
    position: relative;
    z-index: 5;
}

.music-view .vinyl-wrapper.playing .vinyl-record { animation-play-state: running; }
.music-view .vinyl-cover { width: 170px; height: 170px; border-radius: 50%; background: linear-gradient(135deg, #222, #0a0a0a); border: 1px solid #000; }

.music-view .notes-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s;
}

.music-view .vinyl-wrapper.playing .notes-container { opacity: 1; }
.music-view .note { position: absolute; color: rgba(255,255,255,0.2); animation: music-float-up 4s infinite linear; opacity: 0; }
.music-view .note:nth-child(1) { left: 10%; bottom: 20%; animation-delay: 0s; font-size: 16px; }
.music-view .note:nth-child(2) { left: 80%; bottom: 30%; animation-delay: 1.2s; font-size: 24px; }
.music-view .note:nth-child(3) { left: 20%; bottom: 50%; animation-delay: 2.5s; font-size: 18px; }

@keyframes music-float-up {
    0% { transform: translateY(0) scale(0.8) rotate(-10deg); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-120px) scale(1.2) rotate(20deg); opacity: 0; }
}

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

.music-view .player-controls-bottom { margin-top: auto; padding-bottom: 20px; }
.music-view .progress-container { display: flex; align-items: center; gap: 12px; font-size: 10px; color: var(--text-sub); margin-bottom: 40px; font-weight: 500; }
.music-view .progress-bar { flex: 1; height: 2px; background: rgba(255,255,255,0.1); border-radius: 1px; }
.music-view .progress-fill { width: 35%; height: 100%; background: var(--theme-accent); border-radius: 1px; position: relative; }
.music-view .progress-fill::after { content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; background: #fff; border-radius: 50%; box-shadow: 0 0 8px rgba(255,255,255,0.8); }
.music-view .main-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 10px; }
.music-view .ctrl-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.music-view .ctrl-btn svg { width: 22px; height: 22px; fill: var(--text-main); }
.music-view .btn-play-big { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1); }
.music-view .btn-play-big svg { width: 28px; height: 28px; fill: var(--text-main); }

/* --- Connect Room & Modals --- */
.music-view .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.music-view .modal-overlay.show { opacity: 1; pointer-events: auto; }

.music-view .setup-modal {
    width: 85%;
    max-width: 340px;
    padding: 28px 24px;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.music-view .setup-title { font-size: 16px; font-weight: 600; text-align: center; letter-spacing: 1px; }
.music-view .setup-label { font-size: 12px; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.music-view .role-selector { display: flex; justify-content: space-between; padding: 0 10px; }

.music-view .role-item {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: 0.2s;
    cursor: pointer;
}

.music-view .role-item.selected {
    background: rgba(255,255,255,0.1);
    border-color: var(--theme-accent);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.music-view .action-btn {
    padding: 16px;
    border-radius: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    cursor: pointer;
    letter-spacing: 1px;
    border: 1px solid rgba(255,255,255,0.15);
    transition: 0.2s;
}

.music-view .action-btn:active { transform: scale(0.97); }

/* Playlist / Search Bottom Modal */
.music-view .bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
}

.music-view .modal-overlay.show .bottom-sheet { transform: translateY(0); }
.music-view .sheet-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0 auto 24px auto; }

/* --- Room Page Overlay --- */
.music-view .room-page {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: var(--bg-gradient);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.music-view .room-page.show { transform: translateX(0); }

/* Room Header */
.music-view .room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-top: env(safe-area-inset-top);
}

.music-view .room-title-box { text-align: center; flex: 1; }
.music-view .room-title { font-size: 15px; font-weight: 600; letter-spacing: 0.5px; }
.music-view .room-subtitle { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.music-view .icon-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.music-view .icon-btn svg { width: 22px; height: 22px; fill: var(--text-main); }

/* Room Visuals (Avatars & Soundwaves) */
.music-view .room-visuals {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 20px 0 12px 0;
}

.music-view .soundwave { display: flex; gap: 3px; align-items: center; height: 24px; }

.music-view .soundwave span {
    width: 3px;
    background: var(--text-sub);
    border-radius: 1.5px;
    animation: music-wave-bounce 1.2s ease-in-out infinite alternate;
}

.music-view .soundwave.active span { background: var(--text-main); }
.music-view .soundwave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.music-view .soundwave span:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.music-view .soundwave span:nth-child(3) { height: 24px; animation-delay: 0.4s; }
.music-view .soundwave span:nth-child(4) { height: 12px; animation-delay: 0.6s; }

@keyframes music-wave-bounce {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

.music-view .overlapping-avatars { display: flex; align-items: center; }

.music-view .ava-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2a2a, #111111);
    border: 3px solid #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.music-view .ava-circle:nth-child(2) { margin-left: -16px; z-index: 2; border-color: #1a1a1a; }

/* Lyrics */
.music-view .room-lyrics {
    text-align: center;
    font-size: 13px;
    color: var(--text-sub);
    padding: 0 40px;
    margin-bottom: 24px;
    height: 20px;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Chat Area */
.music-view .chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
}

.music-view .chat-area::-webkit-scrollbar { display: none; }
.music-view .chat-row { display: flex; width: 100%; }
.music-view .chat-row.left { justify-content: flex-start; }
.music-view .chat-row.right { justify-content: flex-end; }

.music-view .chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 78%;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.music-view .chat-row.left .chat-bubble { border-top-left-radius: 4px; }

.music-view .chat-row.right .chat-bubble {
    border-top-right-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Bottom Chat Input */
.music-view .chat-input-wrapper {
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom)) 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(12, 12, 12, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
}

.music-view .chat-input {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-main);
    padding: 0 20px;
    outline: none;
    font-size: 14px;
    transition: 0.2s;
}

.music-view .chat-input:focus { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); }
.music-view .chat-input::placeholder { color: var(--text-sub); }

.music-view .chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--text-main);
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.music-view .chat-send-btn:active { transform: scale(0.9); }
.music-view .chat-send-btn svg { width: 18px; height: 18px; fill: #000; transform: translateX(2px); }
