:root {
    --amoled-black: #000000;
    --surface-solid: #08080a;
    --surface-card: #111115;
    --border-prime: #161622;
    --text-white: #ffffff;
    --text-dim: #71717a;
    --accent-pure: #ffffff;
    
    --font-system: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ultra-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --bounce-click: cubic-bezier(0.25, 1, 0.5, 1.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--amoled-black);
    color: var(--text-white);
    font-family: var(--font-system);
    height: 100vh;
    overflow: hidden;
    letter-spacing: -0.02em;
}

/* Master Custom Scrollbar Elements Configuration */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--amoled-black);
}
::-webkit-scrollbar-thumb {
    background: #1f1f29;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2e2e3f;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

.app-header {
    height: 88px;
    border-bottom: 1px solid var(--border-prime);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    background-color: var(--amoled-black);
    z-index: 50;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    user-select: none;
    cursor: pointer;
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.2s var(--bounce-click);
}
.brand-logo:active { transform: scale(0.95); }

.search-container {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.search-container input {
    width: 100%;
    background-color: var(--surface-solid);
    border: 1px solid var(--border-prime);
    border-radius: 30px;
    padding: 14px 20px 14px 54px;
    color: var(--text-white);
    font-family: var(--font-system);
    font-size: 0.92rem;
    transition: all 0.4s var(--ultra-smooth);
}

.search-container input:focus {
    outline: none;
    border-color: #3f3f46;
    background-color: var(--surface-card);
    box-shadow: 0 0 20px rgba(255,255,255,0.02);
}

.search-trigger-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.viewport-feed {
    flex: 1;
    overflow-y: scroll;
    padding: 40px 48px 180px 48px;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}

.content-block {
    margin-bottom: 56px;
}

.content-block.hidden {
    display: none !important;
}

.feed-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: #f4f4f5;
    letter-spacing: -0.03em;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 28px;
}

.media-card-node {
    background-color: var(--surface-solid);
    border: 1px solid var(--border-prime);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.4s var(--bounce-click), background-color 0.4s var(--ultra-smooth), border-color 0.4s var(--ultra-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
}

.media-card-node:hover {
    transform: translateY(-6px) scale(1.01);
    background-color: var(--surface-card);
    border-color: #2c2c3a;
}

.media-card-node:active {
    transform: translateY(-2px) scale(0.98);
}

.artwork-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background-color: #0b0b0d;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.artwork-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ultra-smooth);
}

.media-card-node:hover .artwork-frame img {
    transform: scale(1.06);
}

.floating-card-play-trigger {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: var(--text-white);
    color: var(--amoled-black);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7) translateY(12px);
    transition: all 0.4s var(--ultra-smooth);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-size: 0.95rem;
}

.media-card-node:hover .floating-card-play-trigger {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.node-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    color: #f4f4f5;
}

.node-artist {
    font-size: 0.84rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-navigation-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease, transform 0.2s ease;
}
.back-navigation-btn:hover { color: #fff; transform: translateX(-2px); }

.album-header-hero {
    display: flex;
    align-items: flex-end;
    gap: 36px;
    margin-bottom: 44px;
}

.album-hero-art-frame {
    width: 200px;
    height: 200px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
    border: 1px solid var(--border-prime);
}

.album-hero-art-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-hero-meta span {
    background-color: #1c1c24;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.album-hero-meta h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 16px 0 8px 0;
    letter-spacing: -0.04em;
    color: #fff;
}

.album-tracks-list-table {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-prime);
    padding-top: 20px;
}

.track-row-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s var(--ultra-smooth), transform 0.2s var(--bounce-click);
}

.track-row-item:hover {
    background-color: #0e0e12;
    transform: scale(1.005);
}
.track-row-item:active { transform: scale(0.995); }

.track-row-index {
    width: 44px;
    color: var(--text-dim);
    font-weight: 500;
}

.track-row-details {
    flex: 1;
    font-size: 0.98rem;
    font-weight: 500;
}

.track-row-duration {
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.master-deck-player {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    height: 105px;
    background: rgba(4, 4, 5, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-prime);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 100;
    transition: transform 0.65s var(--ultra-smooth);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.master-deck-player.deck-active-state {
    transform: translateY(-150px);
}

.timeline-interaction-layer {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    pointer-events: none;
}

.timeline-interaction-layer * { pointer-events: auto; }

.scrub-rail-outer-spacer {
    padding: 14px 0;
    flex: 1;
    margin: 0 24px;
    cursor: pointer;
}

.runtime-stamp {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    margin-top: 18px;
    font-weight: 500;
}

.scrub-rail-base {
    width: 100%;
    height: 4px;
    background-color: #16161c;
    border-radius: 2px;
    position: relative;
    transition: height 0.2s ease;
}

.scrub-rail-outer-spacer:hover .scrub-rail-base {
    height: 6px;
}

.scrub-rail-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 2px;
    position: relative;
}

.scrub-rail-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}
.scrub-rail-outer-spacer:hover .scrub-rail-fill::after {
    transform: translateY(-50%) scale(1);
}

.quality-selector-frame select {
    background-color: var(--surface-solid);
    border: 1px solid var(--border-prime);
    color: #e4e4e7;
    font-family: var(--font-system);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.quality-selector-frame select:hover { border-color: #3f3f46; }

.action-util-deck-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s var(--bounce-click);
}
.action-util-deck-btn:hover { color: #fff; }
.action-util-deck-btn:active { transform: scale(0.85); }

.hide-by-default {
    display: none !important;
}

.hide-by-default.visible-album-mode {
    display: flex !important;
}

.deck-content-split {
    display: grid;
    grid-template-columns: 30% 40% 30%;
    align-items: center;
    padding: 0 48px;
    margin-top: 14px;
    width: 100%;
}

.meta-profile-block {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.meta-profile-block img {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border-prime);
    flex-shrink: 0;
}

.meta-text-stack { 
    overflow: hidden;
    min-width: 0;
}

.track-title-string {
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f4f4f5;
}

.track-artist-string {
    font-size: 0.84rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.hardware-playback-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
}

.deck-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s var(--bounce-click);
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.deck-btn:hover { color: #fff; }
.deck-btn:active { transform: scale(0.8); }

.deck-btn.active-state {
    color: #ffffff !important;
    background-color: #161622;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
    box-shadow: inset 0 0 8px rgba(255,255,255,0.05);
}

.core-play-trigger {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--text-white);
    color: var(--amoled-black) !important;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px rgba(255,255,255,0.15);
}
.core-play-trigger:hover { transform: scale(1.05); }
.core-play-trigger:active { transform: scale(0.9); }

.peripheral-audio-controls {
    display: flex;
    align-items: center;
    gap: 22px;
    justify-content: flex-end;
    color: var(--text-dim);
}

.volume-container-slice {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-rail-outer-spacer {
    padding: 10px 0;
    cursor: pointer;
}

.volume-slider-width { width: 85px; }

.mobile-action-trigger { display: none; }

.action-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ultra-smooth);
}

.action-drawer-overlay.drawer-open {
    opacity: 1;
    pointer-events: auto;
}

.action-drawer-surface {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-solid);
    border-top: 1px solid var(--border-prime);
    border-radius: 24px 24px 0 0;
    padding: 20px 24px 44px 24px;
    transform: translateY(100%);
    transition: transform 0.45s var(--ultra-smooth);
}

.action-drawer-overlay.drawer-open .action-drawer-surface {
    transform: translateY(0);
}

.drawer-drag-handle {
    width: 40px;
    height: 4px;
    background-color: #27272a;
    border-radius: 2px;
    margin: 0 auto 24px auto;
}

.drawer-header-meta {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-prime);
    padding-bottom: 16px;
}

.drawer-track-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.drawer-track-artist {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.drawer-interactive-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.drawer-option-row select {
    background-color: #111115;
    border: 1px solid var(--border-prime);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    outline: none;
    font-weight: 600;
}

.drawer-action-btn {
    background-color: var(--text-white);
    color: var(--amoled-black);
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s var(--bounce-click);
}
.drawer-action-btn:active { transform: scale(0.95); }

.functional-fade-in {
    animation: smoothFadeIn 0.6s var(--ultra-smooth) forwards;
}

@keyframes smoothFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-loader-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 0;
    visibility: hidden;
}

.scroll-loader-container.active-state { visibility: visible; }

.pulsing-orbit-spinner {
    width: 26px;
    height: 26px;
    border: 2px solid var(--border-prime);
    border-top-color: var(--text-white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 📱 SOLID DRIFT-FREE MOBILE LAYOUT COMPONENT */
@media (max-width: 768px) {
    .app-header {
        padding: 0 20px;
        height: 72px;
    }

    .search-container { max-width: 65%; }
    .viewport-feed { padding: 24px 20px 180px 20px; }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 16px;
    }
    
    .media-card-node { padding: 12px; border-radius: 14px; }
    
    .album-header-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .album-hero-art-frame { width: 150px; height: 150px; }
    .album-hero-meta h1 { font-size: 2rem; }

    .master-deck-player { height: 88px; }
    .timeline-interaction-layer { top: -6px; padding: 0 20px; }
    .scrub-rail-outer-spacer { margin: 0 10px; padding: 10px 0; }

    /* Strict Mobile View Grid: Info (Left), Controls (Center Locked), Option (Right) */
    .deck-content-split { 
        display: grid;
        grid-template-columns: 1fr auto 44px; 
        align-items: center;
        padding: 0 20px; 
        margin-top: 12px;
        gap: 12px;
    }

    .meta-profile-block { 
        width: 100%; 
        gap: 10px;
        min-width: 0; 
    }
    .meta-profile-block img { width: 44px; height: 44px; }
    .track-title-string { font-size: 0.88rem; }
    .track-artist-string { font-size: 0.76rem; }

    /* Central Controls Container is fully rigid and unbudgeable */
    .hardware-playback-buttons { 
        grid-column: 2;
        width: auto; 
        gap: 14px;
        justify-content: center;
    }
    .core-play-trigger { width: 42px; height: 42px; font-size: 0.95rem; }

    .peripheral-audio-controls { display: none !important; }

    .mobile-action-trigger {
        grid-column: 3;
        display: flex;
        background: none;
        border: none;
        color: var(--text-dim);
        font-size: 1.2rem;
        padding: 8px;
        cursor: pointer;
        justify-content: flex-end;
    }
}