/* ── Now Playing Screen ───────────────────────────────────── */

#now-playing {
    padding: calc(var(--u) * 10) calc(var(--u) * 12) calc(var(--u) * 16);
    background: #fff;
    overflow: hidden;
}

/* ── Artwork + Metadata Row ───────────────────────────────── */

.now-playing-top {
    display: flex;
    gap: calc(var(--u) * 12);
    flex: 1 1 0;
    min-height: 0;
    perspective: calc(var(--u) * 600);
    overflow: visible;
}

/* ── 3D Album Art ─────────────────────────────────────────── */

.artwork-container {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    transform: rotateY(35deg) scaleX(1.04);
    transform-origin: left center;
    transform-style: preserve-3d;
    padding-top: calc(var(--u) * 4);
}

/* Loading placeholder — grey with music note */
.artwork-container::before {
    content: "♫";
    position: absolute;
    top: calc(var(--u) * 4);
    left: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(to bottom, #e8e8e8, #d0d0d0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--u) * 40);
    color: #bbb;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.artwork-container.loading::before {
    opacity: 1;
}

.artwork-container img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    opacity: 1;
    transition: opacity 200ms ease;
    -webkit-box-reflect: below 0 linear-gradient(to bottom, transparent 85%, rgba(0, 0, 0, 0.03) 88%, rgba(0, 0, 0, 0.07) 91%, rgba(0, 0, 0, 0.12) 94%, rgba(0, 0, 0, 0.2) 97%, rgba(0, 0, 0, 0.3) 100%);
}

.artwork-container.loading img {
    opacity: 0;
}

.artwork-container img.loaded {
    opacity: 1;
}

/* ── Track Metadata ───────────────────────────────────────── */

.track-info {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: calc(var(--u) * 30);
    margin-left: calc(var(--u) * -15);
    min-width: 0;
    gap: calc(var(--u) * 1.5);
    transform: translateZ(0.1px);
    /* Prevent perspective blur */
    backface-visibility: hidden;
    overflow: hidden;
}

.track-info .title,
.track-info .artist,
.track-info .album {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
    letter-spacing: calc(var(--u) * -0.4);
}

.track-info .title {
    font-weight: bold;
    font-size: calc(var(--u) * 17);
    color: #000;
}

.track-info .artist,
.track-info .album {
    font-size: calc(var(--u) * 14);
    font-weight: 600;
    color: #616161;
}

/* ── Marquee Scroll Animation ─────────────────────────────── */

.track-info .title.animate-marquee,
.track-info .artist.animate-marquee,
.track-info .album.animate-marquee {
    display: inline-block;
    width: auto;
    min-width: 100%;
    overflow: visible;
}

.animate-marquee {
    display: inline-block !important;
    width: max-content !important;
    text-overflow: clip !important;
    animation: marquee var(--marquee-duration, 10s) linear infinite;
}

@keyframes marquee {

    0%,
    15% {
        transform: translateX(0);
    }

    /* Pause at start */
    45%,
    55% {
        transform: translateX(calc(-1 * var(--marquee-overflow, 0px)));
    }

    /* Pause at end */
    85%,
    100% {
        transform: translateX(0);
    }

    /* Pause on return */
}

/* ── Rating Stars ─────────────────────────────────────────── */

.track-info .rating {
    display: flex;
    gap: calc(var(--u) * 2.5);
    color: #616161;
    line-height: 1;
}

.track-info .rating .star-icon {
    font-size: calc(var(--u) * 15);
    -webkit-font-smoothing: antialiased;
}

.track-info .track-count {
    font-size: calc(var(--u) * 14);
    font-weight: 600;
    letter-spacing: calc(var(--u) * -0.4);
    color: #616161;
}

/* ── Progress Bar ─────────────────────────────────────────── */

.player-controls {
    flex-shrink: 0;
    padding-top: calc(var(--u) * 10);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 6);
    font-size: calc(var(--u) * 13);
    font-weight: bold;
}

.progress-track {
    flex-grow: 1;
    height: calc(var(--u) * 13);
    background: #e6e6e6;
    border-radius: calc(var(--u) * 1);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 calc(var(--u) * 1) calc(var(--u) * 2) rgba(0, 0, 0, 0.05);
    -webkit-box-reflect: below calc(var(--u) * -6) linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to bottom, #1767b8 0%, #2c88ce 45%, #69daff 100%);
    box-shadow: inset 0 calc(var(--u) * 1) 0 rgba(255, 255, 255, 0.4);
    border-radius: calc(var(--u) * 1);
}

.time-label {
    min-width: calc(var(--u) * 35);
    text-align: center;
    letter-spacing: calc(var(--u) * -0.4);
}