*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --p4-c1: #1a1a2e;
    --p4-c2: #e0aaff;
    --p4-c3: #9d4edd;
    --p4-h: 64px;
    --p4-radius: 0px;
    --p4-transition: .35s cubic-bezier(.4,0,.2,1);
}

#p4-shell {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    height: var(--p4-h);
    background-color: var(--p4-c1);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow:
        0 1px 0 rgba(157,78,221,.12),
        0 4px 18px rgba(0,0,0,.22);
    font-family: 'Syne', 'Segoe UI', sans-serif;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow .8s ease;
}

#p4-shell.is-playing {
    animation: p4-shell-breathe 4s ease-in-out infinite alternate;
}
@keyframes p4-shell-breathe {
    from { box-shadow: 0 1px 0 rgba(157,78,221,.15), 0 4px 18px rgba(0,0,0,.22), 0 0 0 rgba(157,78,221,0); }
    to   { box-shadow: 0 1px 0 rgba(157,78,221,.35), 0 4px 28px rgba(0,0,0,.3),  0 0 40px rgba(157,78,221,.08) inset; }
}

#p4-shell::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    z-index: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(157,78,221,.25) 20%,
        var(--p4-c3) 45%,
        var(--p4-c2) 50%,
        var(--p4-c3) 55%,
        rgba(157,78,221,.25) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: p4-topline 6s linear infinite;
    pointer-events: none;
    opacity: .3;
    transition: opacity .8s ease;
}
#p4-shell.is-playing::before {
    opacity: 1;
    animation: p4-topline 3.5s linear infinite;
}
@keyframes p4-topline {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#p4-shell::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 1px;
    z-index: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(157,78,221,.25) 30%,
        rgba(224,170,255,.3) 50%,
        rgba(157,78,221,.25) 70%,
        transparent);
    background-size: 200% 100%;
    animation: p4-botline 8s linear infinite reverse;
    pointer-events: none;
    transition: opacity .6s;
}
#p4-shell.is-playing::after {
    animation: p4-botline 4s linear infinite reverse;
}
@keyframes p4-botline {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

#p4-scan {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(224,170,255,.06) 30%,
        rgba(224,170,255,.18) 50%,
        rgba(224,170,255,.06) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    left: -2px;
    transition: opacity .6s ease;
    filter: blur(1px);
}
#p4-shell.is-playing #p4-scan {
    opacity: 1;
    animation: p4-scan-sweep 7s linear infinite;
}
@keyframes p4-scan-sweep {
    0%   { left: -2px;        opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: .7; }
    100% { left: calc(100% + 2px); opacity: 0; }
}

#p4-glow-orb {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(157,78,221,.08) 0%, transparent 70%);
    top: 50%;
    left: 10%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
    animation: p4-orb 10s ease-in-out infinite alternate;
}
#p4-shell.is-playing #p4-glow-orb {
    opacity: 1;
}
@keyframes p4-orb {
    0%   { left: 10%;  opacity: .2; transform: translate(-50%,-50%) scale(1); }
    50%  { left: 60%;  opacity: .45; transform: translate(-50%,-50%) scale(1.3); }
    100% { left: 90%;  opacity: .15; transform: translate(-50%,-50%) scale(.85); }
}

#p4-meteors {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(.4,0,.2,1);
}
#p4-shell.is-playing #p4-meteors {
    opacity: .7;
}

#p4-sparks {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(.4,0,.2,1);
}
#p4-shell.is-playing #p4-sparks {
    opacity: 1;
}

/* ── Inner layout ── */
#p4-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 20%;
    position: relative;
    z-index: 1;
    gap: 0;
}

@media (max-width: 1200px) { #p4-inner { padding: 0 14%; } }
@media (max-width: 960px)  { #p4-inner { padding: 0 8%;  } }
@media (max-width: 768px)  { #p4-inner { padding: 0 4%;  } }
@media (max-width: 480px)  { #p4-inner { padding: 0 10px; } }
@media (max-width: 360px)  { #p4-inner { padding: 0 6px;  } }

#p4-btn {
    flex: 0 0 auto;
    order: 2;
    width: 48px;
    height: 48px;
    margin: 0 10px 0 14px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border: none;
    background: var(--p4-c1);
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
}

#p4-btn:focus, 
#p4-btn:active, 
#p4-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#p4-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--p4-c3);
    opacity: .4;
    transition: var(--p4-transition);
}
#p4-btn:hover::before,
#p4-shell.is-playing #p4-btn::before {
    opacity: .9;
    transform: scale(1.06);
    box-shadow: 0 0 12px rgba(157,78,221,.5);
}

#p4-btn .p4-ripple,
#p4-btn .p4-ripple2,
#p4-btn .p4-ripple3 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(157,78,221,.4);
    opacity: 0;
    pointer-events: none;
}
#p4-shell.is-playing #p4-btn .p4-ripple  { animation: p4-ripple 3.2s ease-out infinite; }
#p4-shell.is-playing #p4-btn .p4-ripple2 { animation: p4-ripple 3.2s ease-out 1.06s infinite; }
#p4-shell.is-playing #p4-btn .p4-ripple3 { animation: p4-ripple 3.2s ease-out 2.13s infinite; }
@keyframes p4-ripple {
    0%   { transform: scale(1);   opacity: .45; }
    70%  { opacity: .1; }
    100% { transform: scale(2.4); opacity: 0;   }
}

#p4-btn-halo {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(157,78,221,.18) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .6s;
}
#p4-shell.is-playing #p4-btn-halo {
    opacity: 1;
    animation: p4-halo 3.5s ease-in-out infinite alternate;
}
@keyframes p4-halo {
    from { transform: scale(.9);  opacity: .3; }
    to   { transform: scale(1.15); opacity: .7; }
}

#p4-icon {
    width: 22px;
    height: 22px;
    fill: var(--p4-c2);
    transition: var(--p4-transition);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 4px rgba(157,78,221,.35));
}
#p4-shell.is-playing #p4-icon {
    filter: drop-shadow(0 0 8px rgba(157,78,221,.7));
    animation: p4-icon-pulse 2s ease-in-out infinite alternate;
}
@keyframes p4-icon-pulse {
    from { filter: drop-shadow(0 0 5px rgba(157,78,221,.55)); }
    to   { filter: drop-shadow(0 0 10px rgba(224,170,255,.8)); }
}

#p4-art-wrap {
    flex: 0 0 55px;
    height: 55px;
    flex-shrink: 0;
    order: 1;
    position: relative;
    overflow: hidden;
    background: var(--p4-c1);
    z-index: 3;
}

#p4-art-wrap::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--p4-c3)  60deg,
        var(--p4-c2) 120deg,
        transparent  180deg,
        transparent  360deg
    );
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
    z-index: 0;
}
#p4-shell.is-playing #p4-art-wrap::before {
    opacity: 1;
    animation: p4-spin-border 2.8s linear infinite;
}
@keyframes p4-spin-border {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#p4-art {
    position: absolute;
    inset: 2px;
    background-size: cover;
    background-position: center;
    background-image: url('/assets/img/nocover.jpg');
    overflow: hidden;
    z-index: 1;
    transition: filter .4s ease;
}
#p4-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,.07) 3px,
        rgba(0,0,0,.07) 4px
    );
    pointer-events: none;
    z-index: 2;
}
#p4-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(224,170,255,.15) 0%, transparent 65%);
    opacity: 0;
    z-index: 1;
    transition: opacity .5s;
}
#p4-shell.is-playing #p4-art {
    animation: p4-art-pulse 3.5s ease-in-out infinite alternate;
}
#p4-shell.is-playing #p4-art::after {
    animation: p4-art-shine 3.5s ease-in-out infinite alternate;
}
@keyframes p4-art-pulse {
    from { filter: brightness(.95) saturate(1.05); }
    to   { filter: brightness(1.1) saturate(1.3); }
}
@keyframes p4-art-shine {
    from { opacity: 0; }
    to   { opacity: .85; }
}

.p4-sep {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,.08);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

#p4-eq {
    flex: 0 0 auto;
    order: 3;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
    margin: 0 14px;
    opacity: 0;
    transition: opacity .6s ease;
    position: relative;
    z-index: 3;
}
#p4-shell.is-playing #p4-eq { opacity: 1; }
#p4-eq span {
    display: block;
    width: 3px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, var(--p4-c3), var(--p4-c2));
    height: 8px;
    box-shadow: 0 0 4px rgba(157,78,221,.4);
}
#p4-shell.is-playing #p4-eq span:nth-child(1) { animation: p4-bar 1.1s ease-in-out infinite alternate; }
#p4-shell.is-playing #p4-eq span:nth-child(2) { animation: p4-bar  .8s ease-in-out .15s infinite alternate; }
#p4-shell.is-playing #p4-eq span:nth-child(3) { animation: p4-bar 1.3s ease-in-out .05s infinite alternate; }
#p4-shell.is-playing #p4-eq span:nth-child(4) { animation: p4-bar  .9s ease-in-out .25s infinite alternate; }
#p4-shell.is-playing #p4-eq span:nth-child(5) { animation: p4-bar 1.2s ease-in-out  .1s infinite alternate; }
@keyframes p4-bar {
    from { height: 4px;  opacity: .4; box-shadow: 0 0 2px rgba(157,78,221,.2); }
    to   { height: 22px; opacity: 1;  box-shadow: 0 0 6px rgba(224,170,255,.6); }
}

#p4-info {
    flex: 1 1 0;
    min-width: 0;
    order: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
    padding-right: 10px;
    position: relative;
    z-index: 4;
}

#p4-track-wrap {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
#p4-track-wrap::before,
#p4-track-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 18px;
    z-index: 1;
    pointer-events: none;
}
#p4-track-wrap::before { left: 0; }
#p4-track-wrap::after  { right: 0; }

#p4-track {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--p4-c2);
    white-space: nowrap;
    transition: opacity .4s, text-shadow .8s ease;
}
#p4-shell.is-playing #p4-track {
    animation: p4-track-glow 4s ease-in-out infinite alternate;
}
@keyframes p4-track-glow {
    from { text-shadow: 0 0 6px rgba(157,78,221,.3); }
    to   { text-shadow: 0 0 14px rgba(224,170,255,.55), 0 0 3px rgba(157,78,221,.4); }
}
#p4-track.overflowing {
    animation: p4-marquee 14s linear infinite;
    padding-right: 60px;
}
#p4-shell.is-playing #p4-track.overflowing {
    animation: p4-marquee 14s linear infinite, p4-track-glow 4s ease-in-out infinite alternate;
}
@keyframes p4-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
#p4-track.fade-in {
    animation: p4-fadein .55s ease forwards;
}
@keyframes p4-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

#p4-vol {
    flex: 0 0 auto;
    order: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 0 12px;
    position: relative;
    z-index: 2;
}

#p4-vol-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    fill: var(--p4-c2);
    opacity: .65;
    cursor: pointer;
    transition: opacity .2s, filter .2s;
}
#p4-vol-icon:hover {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(157,78,221,.5));
}

#p4-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,.12);
    outline: none;
    cursor: pointer;
    transition: background .2s;
}
#p4-slider::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
}
#p4-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--p4-c2);
    box-shadow: 0 0 5px rgba(157,78,221,.5);
    transition: transform .15s ease, box-shadow .15s ease;
}
#p4-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(157,78,221,.7);
}
#p4-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: var(--p4-c2);
    box-shadow: 0 0 5px rgba(157,78,221,.5);
}
#p4-slider::-moz-range-progress {
    background: var(--p4-c3);
    height: 3px;
    border-radius: 2px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    #p4-slider { width: 72px; }
}
@media (max-width: 768px) {
    #p4-slider { width: 70px; }
    #p4-vol    { padding: 0 0 0 8px; }
    #p4-eq     { margin: 0 8px; }
    #p4-btn    { margin: 0 6px 0 10px; }
    #p4-mini-cover { display: none !important; }
}
@media (max-width: 480px) {
    :root { --p4-h: 56px; }
    #p4-slider { width: 55px; }
    #p4-eq     { gap: 2px; margin: 0 6px; }
    #p4-eq span { width: 2px; }
    #p4-vol    { padding: 0 0 0 6px; }
    #p4-track  { font-size: 13px; }
    #p4-btn    { width: 40px; height: 40px; margin: 0 4px 0 6px; }
    #p4-glow-orb { display: none; }
}
@media (max-width: 360px) {
    #p4-eq     { display: none; }
    #p4-vol    { padding: 0 0 0 4px; }
    #p4-slider { width: 48px; }
}

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700&display=swap');