@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Manrope:wght@500;600;700&display=swap');

:root {
    --ink: #f7f3f2;
    --muted: #a89b9a;
    --surface: #160a0a;
    --surface-soft: #211010;
    --line: rgba(255, 255, 255, .09);
    --accent: #e42b22;
    --accent-soft: #ff6258;
    --plyr-color-main: var(--accent);
    --plyr-audio-controls-background: transparent;
    --plyr-audio-control-color: var(--muted);
    --plyr-audio-control-background-hover: rgba(220, 173, 114, .12);
    --plyr-menu-background: #242a2e;
    --plyr-menu-color: var(--ink);
    --plyr-range-fill-background: var(--accent);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: #050202; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 13% 8%, rgba(131, 13, 10, .24), transparent 32rem),
        radial-gradient(circle at 88% 43%, rgba(225, 35, 24, .1), transparent 30rem),
        linear-gradient(145deg, #0d0505 0%, #070303 55%, #110404 100%);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

button { font: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }

.logout-link {
    position: absolute;
    top: 28px;
    right: 32px;
    color: var(--muted);
    font-size: .78rem;
    text-decoration: none;
    transition: color .2s ease;
}
.logout-link:hover { color: var(--ink); }

.login-shell {
    display: grid;
    min-height: 100vh;
    padding: 32px;
    place-items: center;
}
.login-page {
    color-scheme: light;
    background:
        radial-gradient(circle at 18% 20%, rgba(21, 44, 176, .12), transparent 34rem),
        radial-gradient(circle at 88% 86%, rgba(45, 67, 190, .08), transparent 28rem),
        #eef1f8;
}
.login-page button:focus-visible,
.login-page input:focus-visible { outline-color: #7488ff; }
.login-card {
    display: grid;
    grid-template-columns: minmax(280px, 470px) minmax(340px, 470px);
    width: min(940px, 100%);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 32px 100px rgba(20, 27, 56, .18);
    backdrop-filter: blur(20px);
}
.login-brand {
    display: grid;
    min-height: 560px;
    padding: 70px;
    place-items: center;
    background: transparent;
}
.login-brand img { display: block; width: min(170px, 80%); height: auto; }
.login-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(38px, 6vw, 70px); color: #0b0e17; background: rgba(255, 255, 255, .96); }
.login-kicker { margin: 0 0 16px; color: #7488ff; font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.login-content h1 { font-size: clamp(2.8rem, 5vw, 4.5rem); }
.login-intro { margin: 20px 0 36px; color: #656c7c; line-height: 1.65; }
.login-error { margin: -14px 0 24px; padding: 11px 13px; border: 1px solid rgba(255, 98, 88, .35); border-radius: 5px; color: #ffaaa4; background: rgba(228, 43, 34, .1); font-size: .82rem; }
.login-form { display: grid; gap: 20px; }
.form-field { display: grid; gap: 8px; }
.form-field label { color: #373d4c; font-size: .78rem; font-weight: 500; }
.form-field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cfd4e1; border-radius: 5px; color: #0b0e17; background: #fff; font: inherit; transition: border-color .2s, background .2s; }
.form-field input:hover, .form-field input:focus { border-color: rgba(21, 44, 176, .75); background: #f9faff; }
.login-submit { height: 49px; margin-top: 8px; border: 0; border-radius: 999px; color: white; background: #152cb0; font-weight: 600; cursor: pointer; transition: background .2s, transform .2s; }
.login-submit:hover { background: #2943d5; transform: translateY(-1px); }

.album-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 72px 0 180px;
}

.album-hero {
    display: grid;
    grid-template-columns: minmax(280px, 430px) 1fr;
    gap: clamp(48px, 8vw, 112px);
    align-items: end;
    margin-bottom: 88px;
}

.cover-wrap { position: relative; }
.cover {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .48), 0 2px 10px rgba(0, 0, 0, .5);
}
.cover-glow {
    position: absolute;
    inset: 15% -8% -10%;
    background: rgba(220, 27, 20, .5);
    filter: blur(70px);
    opacity: .45;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

h1, h2 { font-family: 'Manrope', sans-serif; }
h1 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(3.2rem, 7.3vw, 7.1rem);
    font-weight: 600;
    letter-spacing: -.065em;
    line-height: .91;
}
.album-subtitle {
    margin: 22px 0 0;
    color: var(--accent-soft);
    font-family: 'Manrope', sans-serif;
    font-size: clamp(.82rem, 1.4vw, 1rem);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.artist { margin: 26px 0 8px; color: #e4dedd; font-size: 1.18rem; font-weight: 500; }
.album-meta { margin: 0; color: var(--muted); font-size: .9rem; }
.album-meta span { margin: 0 7px; color: #555e63; }

.album-actions { display: flex; gap: 12px; margin-top: 38px; }
.play-album, .icon-button {
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.play-album {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 49px;
    padding: 0 24px;
    border-radius: 999px;
    color: #160303;
    background: var(--accent);
    font-weight: 600;
}
.play-album:hover { transform: translateY(-2px); background: var(--accent-soft); }
.play-album svg { width: 17px; fill: currentColor; }
.icon-button {
    display: grid;
    width: 49px;
    height: 49px;
    place-items: center;
    border-color: var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
}
.icon-button:hover, .icon-button[aria-pressed='true'] { color: var(--accent-soft); border-color: rgba(228, 43, 34, .55); }
.icon-button[aria-pressed='true'] svg { fill: currentColor; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.track-panel { max-width: 940px; margin-left: auto; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 18px 23px; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.total-duration { margin: 0 0 3px; color: var(--muted); font-size: .82rem; }
.track-list { margin: 0; padding: 0; list-style: none; }
.track { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; width: 100%; min-height: 67px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; transition: background .2s ease; }
.track:hover, .track.is-active { background: rgba(255, 255, 255, .035); }
.track.is-active .track-title { color: var(--accent-soft); }
.track-number { position: relative; display: grid; width: 22px; height: 22px; place-items: center; color: #687176; font-size: .76rem; font-variant-numeric: tabular-nums; }
.track-play { display: none; width: 15px; fill: var(--ink); }
.track:hover .number { display: none; }
.track:hover .track-play { display: block; }
.track.is-playing .number, .track.is-playing .track-play { display: none; }
.playing-bars { display: none; align-items: end; gap: 2px; height: 14px; }
.track.is-playing .playing-bars { display: flex; }
.playing-bars i { width: 2px; height: 100%; background: var(--accent); animation: meter .8s ease-in-out infinite alternate; }
.playing-bars i:nth-child(2) { height: 60%; animation-delay: -.3s; }
.playing-bars i:nth-child(3) { height: 80%; animation-delay: -.5s; }
@keyframes meter { to { height: 25%; } }
.track-title { font-size: .96rem; font-weight: 500; }
.track-duration { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

.player-dock {
    position: fixed;
    z-index: 20;
    right: 20px;
    bottom: 18px;
    left: 20px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(420px, 620px) minmax(190px, 1fr);
    gap: 24px;
    align-items: center;
    min-height: 108px;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(21, 8, 8, .92);
    box-shadow: 0 16px 60px rgba(0, 0, 0, .46);
    backdrop-filter: blur(22px);
}
.player-error {
    position: absolute;
    right: 18px;
    bottom: calc(100% + 10px);
    max-width: min(460px, calc(100vw - 36px));
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 98, 88, .38);
    border-radius: 6px;
    color: #ffd7d4;
    background: rgba(62, 10, 8, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    font-size: .78rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity .2s ease, transform .2s ease;
}
.player-error.is-visible { opacity: 1; transform: translateY(0); }
.now-playing { display: flex; gap: 14px; align-items: center; min-width: 0; }
.now-playing img { width: 56px; height: 56px; border-radius: 3px; object-fit: cover; }
.now-playing div { min-width: 0; }
.current-title, .current-artist { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.current-title { font-size: .9rem; font-weight: 600; }
.current-artist { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.transport-controls { display: flex; align-items: center; justify-content: center; gap: 10px; height: 37px; }
.transport { display: grid; width: 35px; height: 35px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #d7d9d9; background: transparent; cursor: pointer; transition: color .2s, background .2s, transform .2s; }
.transport:hover { color: white; background: rgba(255, 255, 255, .07); }
.transport svg { width: 19px; fill: currentColor; }
.transport svg path { vector-effect: non-scaling-stroke; }
.transport.secondary { color: #788085; }
.transport.secondary svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.transport.secondary[aria-pressed='true'] { color: var(--accent); }
.play-toggle { width: 37px; height: 37px; margin: 0 4px; color: #170303; background: var(--ink); }
.play-toggle:hover { color: #170303; background: var(--accent-soft); transform: scale(1.05); }
.pause-icon, .is-playing .play-icon { display: none; }
.is-playing .pause-icon { display: block; }
.player-main .plyr { margin-top: -4px; }
.player-main .plyr__controls { padding: 0; }
.player-main .plyr__control[data-plyr='play'] { display: none; }
.player-main .plyr__progress__container { margin-left: 0; }
.player-main .plyr__time {
    flex: none;
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
}
.player-main .plyr__time--current {
    width: 5ch;
    padding-right: 0 !important;
    text-align: right;
}
.player-main .plyr__time--duration {
    width: auto;
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-align: left;
}
.player-main .plyr__time + .plyr__time::before {
    margin-right: .5ch;
    margin-left: .5ch;
}
.player-main .plyr__time + .plyr__time {
    margin-left: 0 !important;
    padding-left: 0 !important;
}
.player-main .plyr__volume { max-width: 105px; }

@media (max-width: 900px) {
    .album-shell { padding-top: 40px; }
    .album-hero { grid-template-columns: minmax(220px, 340px) 1fr; gap: 38px; }
    .player-dock { grid-template-columns: 160px 1fr; }
    .dock-spacer { display: none; }
}

@media (max-width: 650px) {
    .album-shell { width: min(100% - 30px, 480px); padding: 24px 0 190px; }
    .album-hero { grid-template-columns: 1fr; gap: 34px; margin-bottom: 62px; }
    .cover-wrap { width: min(100%, 390px); margin: 0 auto; }
    h1 { font-size: clamp(3rem, 17vw, 5.1rem); }
    .artist { margin-top: 22px; }
    .panel-heading { padding-right: 8px; padding-left: 8px; }
    .track { grid-template-columns: 38px 1fr auto; padding: 0 8px; }
    .player-dock { right: 8px; bottom: 8px; left: 8px; grid-template-columns: 1fr; gap: 5px; min-height: 150px; padding: 12px 16px 9px; }
    .now-playing img { width: 44px; height: 44px; }
    .dock-spacer { display: none; }
    .transport-controls { position: absolute; top: 15px; right: 13px; gap: 2px; }
    .transport.secondary { display: none; }
    .player-main .plyr { margin-top: 2px; }
    .logout-link { top: 12px; right: 16px; }
    .login-shell { padding: 15px; }
    .login-card { grid-template-columns: 1fr; }
    .login-brand { min-height: 210px; padding: 34px; }
    .login-brand img { width: 92px; }
    .login-content { padding: 34px 26px 40px; }
}

@media (prefers-color-scheme: dark) {
    .login-page {
        color-scheme: dark;
        background:
            radial-gradient(circle at 18% 20%, rgba(21, 44, 176, .2), transparent 34rem),
            radial-gradient(circle at 88% 86%, rgba(45, 67, 190, .12), transparent 28rem),
            #05070d;
    }
    .login-page .login-card {
        border-color: rgba(116, 136, 255, .16);
        background: transparent;
        box-shadow: 0 32px 100px rgba(0, 0, 0, .52);
    }
    .login-page .login-brand {
        border-right: 1px solid rgba(255, 255, 255, .08);
        background: transparent;
    }
    .login-page .login-brand img {
        filter: brightness(0) invert(1);
    }
    .login-page .login-content { color: var(--ink); background: rgba(8, 11, 18, .94); }
    .login-page .login-intro { color: var(--muted); }
    .login-page .form-field label { color: #c9c0bf; }
    .login-page .form-field input {
        border-color: rgba(255, 255, 255, .13);
        color: var(--ink);
        background: rgba(0, 0, 0, .25);
    }
    .login-page .form-field input:hover,
    .login-page .form-field input:focus {
        border-color: rgba(85, 110, 255, .75);
        background: rgba(0, 0, 0, .38);
    }
}

@media (max-width: 650px) and (prefers-color-scheme: dark) {
    .login-page .login-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
