:root {
    --bg-1: #090312;
    --bg-2: #140726;
    --bg-3: #1e0a3c;
    --accent-1: #ff2fb3;
    --accent-2: #5ce1ff;
    --accent-3: #8d4dff;
    --text-1: #ffffff;
    --text-2: rgba(255, 255, 255, 0.74);
    --line: rgba(255, 255, 255, 0.10);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --shadow-1: 0 20px 60px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 12px 40px rgba(255, 47, 179, 0.20);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --transition: 220ms ease;
    --max-width: 1180px;
    --dynamic-accent-1: #ff2fb3;
    --dynamic-accent-2: #5ce1ff;
    --dynamic-accent-3: #8d4dff;
    --dynamic-glow-1: rgba(255, 47, 179, 0.24);
    --dynamic-glow-2: rgba(92, 225, 255, 0.20);
    --dynamic-shadow: rgba(181, 23, 158, 0.35);
    --dynamic-border: rgba(255, 255, 255, 0.10);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100svh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-1);
    background:
        radial-gradient(circle at 20% 15%, var(--dynamic-glow-1), transparent 28%),
        radial-gradient(circle at 80% 20%, var(--dynamic-glow-2), transparent 24%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
    overflow-x: hidden;
    transition: background 600ms ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.page {
    position: relative;
    min-height: 100svh;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page__bg-art {
    position: absolute;
    inset: 0;
    background-image: url("../imgs/BG120BPM.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.18;
    transform: scale(1.06);
    filter: blur(2px);
    z-index: -4;
}

.page__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 3, 11, 0.55) 0%, rgba(5, 3, 11, 0.35) 30%, rgba(5, 3, 11, 0.68) 100%);
    z-index: -3;
}

.page__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    z-index: -5;
}

.page__glow--one {
    width: 420px;
    height: 420px;
    top: -60px;
    left: -100px;
    background: var(--dynamic-glow-1);
}

.page__glow--two {
    width: 460px;
    height: 460px;
    right: -120px;
    bottom: -120px;
    background: var(--dynamic-glow-2);
}

.site-header {
    position: relative;
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 14px 0 0;
    z-index: 2;
    flex: 0 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand__logo {
    width: clamp(84px, 9vw, 130px);
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(255, 47, 179, 0.18));
}

.hero {
    width: min(calc(100% - 32px), var(--max-width));
    flex: 1;
    min-height: 0;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 22px 0 18px;
}

.hero-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.recent-tracks {
    width: 100%;
    padding: 16px 18px 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-1);
}

.recent-tracks__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.recent-tracks__label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.70);
}

.recent-tracks__list {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.recent-tracks__list::-webkit-scrollbar {
    height: 8px;
}

.recent-tracks__list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
}

.recent-track {
    min-width: 220px;
    max-width: 220px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.recent-track:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.08);
}

.recent-track__cover {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.recent-track__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-track__title,
.recent-track__artist {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-track__title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
}

.recent-track__artist {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.68);
}

.recent-track--placeholder .recent-track__cover {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
}

@media (max-width: 640px) {
    .recent-tracks {
        padding: 14px;
        border-radius: 20px;
    }

    .recent-track {
        min-width: 190px;
        max-width: 190px;
    }

    .hero-stack {
        gap: 14px;
    }
}

.player-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 430px);
    gap: 34px;
    align-items: center;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.05));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-1);
}

.player-card__content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.live-chip__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #21ff88;
    box-shadow: 0 0 0 0 rgba(33, 255, 136, 0.55);
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(33, 255, 136, 0.55); }
    70% { box-shadow: 0 0 0 12px rgba(33, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 255, 136, 0); }
}

.hero__title {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hero__subtitle {
    margin: 0;
    max-width: 56ch;
    color: var(--text-2);
    font-size: clamp(1rem, 1.25vw, 1.08rem);
    line-height: 1.65;
}

.now-playing-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--dynamic-border);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 10px 30px rgba(0, 0, 0, 0.10);
}

.now-playing-card__label {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.62);
}

.track-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 2.2rem);
    line-height: 1.15;
    word-break: break-word;
}

.track-artist {
    margin: 10px 0 0;
    color: var(--text-2);
    font-size: clamp(1rem, 1.4vw, 1.12rem);
    word-break: break-word;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.play-button {
    width: 76px;
    height: 76px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dynamic-accent-1), var(--dynamic-accent-3));
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 14px 40px var(--dynamic-shadow);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background 600ms ease;
}

.play-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 46px rgba(181, 23, 158, 0.42);
}

.play-button:active {
    transform: scale(0.98);
}

.equalizer {
    display: flex;
    align-items: end;
    gap: 7px;
    height: 34px;
}

.equalizer span {
    width: 5px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
    opacity: 0.4;
    transform-origin: bottom center;
}

.equalizer.is-active span {
    opacity: 1;
    animation: eqBounce 0.9s infinite ease-in-out;
}

.equalizer.is-active span:nth-child(2) { animation-delay: 0.12s; }
.equalizer.is-active span:nth-child(3) { animation-delay: 0.24s; }
.equalizer.is-active span:nth-child(4) { animation-delay: 0.36s; }
.equalizer.is-active span:nth-child(5) { animation-delay: 0.48s; }

@keyframes eqBounce {
    0%, 100% { height: 8px; }
    50% { height: 30px; }
}

.social-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.social-links a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.06);
    color: #fff;
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.social-links a:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.26);
}

.store-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.store-buttons a img {
    width: 150px;
    height: auto;
    transition: transform var(--transition), opacity var(--transition);
}

.store-buttons a:hover img {
    transform: translateY(-2px);
    opacity: 0.92;
}

.player-card__media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-shell {
    position: relative;
    width: min(100%, 390px);
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
}

.album-shell__halo {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background:
        conic-gradient(
            from 0deg,
            var(--dynamic-accent-1),
            var(--dynamic-accent-2),
            var(--dynamic-accent-3),
            var(--dynamic-accent-1)
        );
    filter: blur(34px);
    opacity: 0.72;
    animation: haloSpin 12s linear infinite;
    transition: background 600ms ease, opacity 600ms ease;
}

.page__glow,
.album-shell__halo,
.album-cover,
.now-playing-card,
.play-button {
    transition:
        background 600ms ease,
        box-shadow 600ms ease,
        border-color 600ms ease,
        opacity 600ms ease,
        filter 600ms ease;
}

@keyframes haloSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.album-cover {
    position: relative;
    z-index: 2;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    box-shadow:
        0 24px 60px rgba(0,0,0,0.42),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    transform: translateZ(0);
}

.is-reconnecting .live-chip__dot {
    background: #ffba2f;
}

.is-reconnecting #liveStatusText {
    color: #ffdf9a;
}

@media (max-width: 980px) {
    .player-card {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 24px;
    }

    .player-card__media {
        order: -1;
    }

    .album-shell {
        width: min(100%, 320px);
    }

    .hero {
        padding-top: 10px;
        padding-bottom: 24px;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding-top: 12px;
    }

    .hero {
        width: min(calc(100% - 20px), var(--max-width));
        min-height: auto;
        padding-top: 8px;
        padding-bottom: 18px;
    }

    .player-card {
        padding: 18px;
        border-radius: 24px;
    }

    .hero__title {
        font-size: 2.2rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .track-title {
        font-size: 1.35rem;
    }

    .track-artist {
        font-size: 1rem;
    }

    .play-button {
        width: 68px;
        height: 68px;
    }

    .store-buttons {
        justify-content: center;
    }

    .store-buttons a img {
        width: 138px;
    }

    .social-links {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.lyrics-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 18px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.lyrics-button:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.24);
}

.lyrics-button.is-active {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
}

.lyrics-card {
    margin-top: 18px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--dynamic-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 14px 36px rgba(0,0,0,0.16);
}

.lyrics-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.lyrics-card__label {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.62);
}

.lyrics-card__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
    color: #fff;
}

.lyrics-card__artist {
    margin: 6px 0 0;
    color: rgba(255,255,255,0.70);
    font-size: 0.95rem;
}

.lyrics-card__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    transition: transform 220ms ease, background 220ms ease;
}

.lyrics-card__close:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.12);
}

.lyrics-card__body {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
    color: rgba(255,255,255,0.92);
    line-height: 1.75;
    white-space: pre-line;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.20) transparent;
}

.lyrics-card__body::-webkit-scrollbar {
    width: 8px;
}

.lyrics-card__body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.20);
    border-radius: 999px;
}

.lyrics-loading,
.lyrics-empty,
.lyrics-error {
    margin: 0;
    color: rgba(255,255,255,0.75);
}

.lyrics-text {
    margin: 0;
}

@media (max-width: 640px) {
    .lyrics-button {
        height: 44px;
        padding: 0 15px;
    }

    .lyrics-card {
        padding: 16px;
        border-radius: 18px;
    }

    .lyrics-card__body {
        max-height: 280px;
    }
}