/* Spotify Pulse visual upgrades — stage, DNA, podium, streak, constellation, queue fan, mosaic, mood */

/* ── Mood edge glow (tasteful, not purple spam) ── */
.dash-mood-edge {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease, background 0.9s ease;
    background:
        radial-gradient(ellipse 55% 28% at 0% 40%, var(--mood-edge-a, transparent) 0%, transparent 70%),
        radial-gradient(ellipse 55% 28% at 100% 60%, var(--mood-edge-b, transparent) 0%, transparent 70%);
}

.dash-mood-edge.is-on {
    opacity: 1;
}

.dash-mood-edge--energetic {
    --mood-edge-a: rgba(30, 215, 96, 0.14);
    --mood-edge-b: rgba(255, 196, 72, 0.1);
}

.dash-mood-edge--calm {
    --mood-edge-a: rgba(94, 228, 199, 0.12);
    --mood-edge-b: rgba(120, 180, 200, 0.1);
}

.dash-mood-edge--moody {
    --mood-edge-a: rgba(80, 100, 140, 0.16);
    --mood-edge-b: rgba(40, 50, 70, 0.14);
}

.dash-mood-edge--balanced {
    --mood-edge-a: rgba(30, 215, 96, 0.08);
    --mood-edge-b: rgba(243, 235, 224, 0.05);
}

/* ── Now-playing stage ── */
.page--spotify .dash-now--stage {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    padding: 1rem 0.85rem 1.15rem;
    isolation: isolate;
    background:
        linear-gradient(
            165deg,
            rgba(var(--sp-ambient-r, 26), var(--sp-ambient-g, 21), var(--sp-ambient-b, 32), 0.2) 0%,
            rgba(18, 18, 18, 0.72) 48%,
            rgba(12, 12, 12, 0.88) 100%
        );
    border: 1px solid rgba(var(--sp-ambient-r, 26), var(--sp-ambient-g, 21), var(--sp-ambient-b, 32), 0.2);
    box-shadow:
        0 1.5rem 3rem rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 3.5rem rgba(var(--sp-ambient-r, 26), var(--sp-ambient-g, 21), var(--sp-ambient-b, 32), 0.14);
}

.dash-now__stage-bg {
    position: absolute;
    inset: -8%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dash-now__stage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(52px) saturate(1.08) brightness(0.68);
    transform: scale(1.22);
    opacity: 0.32;
    transition: opacity 0.6s ease;
}

.dash-now__stage-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(9, 9, 9, 0.28) 0%, rgba(9, 9, 9, 0.62) 48%, rgba(9, 9, 9, 0.9) 100%),
        radial-gradient(
            ellipse 80% 60% at 50% 18%,
            rgba(var(--now-ambient-r, var(--sp-ambient-r, 26)), var(--now-ambient-g, var(--sp-ambient-g, 21)), var(--now-ambient-b, var(--sp-ambient-b, 32)), 0.42) 0%,
            transparent 68%
        ),
        radial-gradient(
            ellipse 70% 50% at 50% 100%,
            rgba(var(--now-ambient-r, var(--sp-ambient-r, 26)), var(--now-ambient-g, var(--sp-ambient-g, 21)), var(--now-ambient-b, var(--sp-ambient-b, 32)), 0.18) 0%,
            transparent 55%
        );
    transition: background 0.9s ease;
}

.page--spotify .dash-now--stage > .dash-now__cover,
.page--spotify .dash-now--stage > .dash-now__panel {
    position: relative;
    z-index: 1;
}

.page--spotify .dash-now--stage .dashboard-hero__art-wrap {
    position: relative;
}

.dash-lyric-peek {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    width: 100%;
    max-width: 28rem;
    margin: 0.15rem auto 0;
    padding: 0.45rem 0.75rem;
    border-radius: 0.65rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}

.dash-lyric-peek[hidden] {
    display: none !important;
}

.dash-lyric-peek__label {
    flex-shrink: 0;
    font-family: "DM Mono", monospace;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sp-accent-bright, #1ed760);
}

.dash-lyric-peek__text {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--cream, #f3ebe0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* ── Top track podium ── */
.dash-podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 0.55rem;
    align-items: end;
    margin: 0.35rem 0 1rem;
}

.dash-podium[hidden] {
    display: none !important;
}

.dash-podium__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dash-podium__item:hover,
.dash-podium__item:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(30, 215, 96, 0.35);
    background: rgba(30, 215, 96, 0.06);
    outline: none;
}

.dash-podium__item--1 {
    order: 2;
    padding-bottom: 0.95rem;
    border-color: rgba(30, 215, 96, 0.28);
    background: rgba(30, 215, 96, 0.07);
}

.dash-podium__item--2 {
    order: 1;
}

.dash-podium__item--3 {
    order: 3;
}

.dash-podium__rank {
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--sp-accent-bright, #1ed760);
}

.dash-podium__cover {
    width: 100%;
    max-width: 6.5rem;
    aspect-ratio: 1;
    border-radius: 0.55rem;
    overflow: hidden;
    box-shadow: 0 0.55rem 1.25rem rgba(0, 0, 0, 0.35);
}

.dash-podium__item--1 .dash-podium__cover {
    max-width: 7.5rem;
}

.dash-podium__art,
.dash-podium__ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dash-podium__meta {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    width: 100%;
}

.dash-podium__title,
.dash-podium__artist {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.25;
}

.dash-podium__title {
    font-size: 0.78rem;
    font-weight: 650;
}

.dash-podium__artist {
    font-size: 0.68rem;
}

/* ── Artist constellation ── */
.dash-constellation {
    margin: 0.35rem 0 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.dash-constellation[hidden] {
    display: none !important;
}

.dash-constellation__svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 8.5rem;
}

.dash-constellation__line {
    stroke: rgba(30, 215, 96, 0.28);
    stroke-width: 1;
    fill: none;
}

.dash-constellation__node {
    cursor: pointer;
}

.dash-constellation__ring {
    fill: none;
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1.25;
}

.dash-constellation__avatar {
    clip-path: circle(50%);
}

.dash-constellation__label {
    fill: var(--sp-text-sub, #b3b3b3);
    font-family: "DM Mono", monospace;
    font-size: 7.5px;
    letter-spacing: 0.03em;
    text-anchor: middle;
}

/* ── Queue cinematic fan (desktop) ── */
.dash-queue-fan {
    display: none;
}

@media (min-width: 900px) {
    .dash-queue-fan {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        height: 7.5rem;
        margin: 0.35rem 0 1rem;
        perspective: 900px;
    }

    .dash-queue-fan[hidden] {
        display: none !important;
    }

    .dash-queue-fan__card {
        width: 5.25rem;
        aspect-ratio: 1;
        margin-left: -1.65rem;
        border-radius: 0.55rem;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 0.65rem 1.4rem rgba(0, 0, 0, 0.4);
        transform:
            translateY(calc(var(--qi, 0) * 0.15rem))
            rotate(calc((var(--qi, 0) - 2.5) * 3.5deg));
        transition: transform 0.25s ease, z-index 0s;
        z-index: calc(10 - var(--qi, 0));
    }

    .dash-queue-fan__card:first-child {
        margin-left: 0;
    }

    .dash-queue-fan__card:hover {
        transform: translateY(-0.55rem) rotate(0deg) scale(1.05);
        z-index: 20;
    }

    .dash-queue-fan__card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .page--spotify .dash-track-list--queue .dash-row--queue {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .page--spotify .dash-section--queue.is-cinematic .dash-row--queue {
        transform: translateX(calc(var(--qi, 0) * 0.15rem));
    }
}

@media (max-width: 899px) {
    .dash-queue-fan {
        display: none !important;
    }
}

/* ── Playlist mosaic ── */
.dash-playlist__cover {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.dash-playlist__cover-img,
.dash-playlist__ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dash-playlist__mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: rgba(0, 0, 0, 0.35);
}

.dash-playlist__mosaic[hidden] {
    display: none !important;
}

.dash-playlist__mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dash-playlist__cover.has-mosaic .dash-playlist__cover-img,
.dash-playlist__cover.has-mosaic .dash-playlist__ph {
    opacity: 0;
    position: absolute;
}

.page--spotify .dash-section--playlists .dash-playlist:hover .dash-playlist__cover {
    transform: scale(1.02);
}

.page--spotify .dash-section--playlists .dash-playlist__cover {
    transition: transform 0.25s ease;
}

/* ── Timeline scrubber ── */
.timeline-scrubber {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0 0 1rem;
    padding: 0.75rem 0 0.55rem;
    background: linear-gradient(180deg, rgba(9, 9, 9, 0.96) 60%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.timeline-scrubber__axis {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0.15rem 0.1rem 0.45rem;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.timeline-scrubber__axis::-webkit-scrollbar {
    display: none;
}

.timeline-scrubber__day {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 4.25rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--sp-text-sub, #b3b3b3);
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.timeline-scrubber__day:hover,
.timeline-scrubber__day:focus-visible {
    border-color: rgba(30, 215, 96, 0.35);
    color: var(--sp-text, #fff);
    outline: none;
}

.timeline-scrubber__day.is-active {
    border-color: rgba(30, 215, 96, 0.45);
    background: rgba(30, 215, 96, 0.12);
    color: var(--sp-accent-bright, #1ed760);
}

.timeline-scrubber__count {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.58rem;
    opacity: 0.75;
}

.timeline-item.is-dimmed {
    opacity: 0.28;
    filter: grayscale(0.35);
}

.timeline-day.is-dimmed {
    opacity: 0.35;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .dash-mood-edge,
    .dash-podium__item,
    .dash-queue-fan__card,
    .page--spotify .dash-section--playlists .dash-playlist__cover {
        transition: none !important;
    }

    .dash-queue-fan__card:hover,
    .dash-podium__item:hover {
        transform: none;
    }

    .dash-now__stage-img {
        filter: blur(28px) saturate(1.1);
    }
}
