.soundtrack {
    position: fixed;
    left: max(20px, env(safe-area-inset-left));
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid rgba(208, 185, 143, .5);
    border-radius: 30px;
    background: rgba(25, 25, 23, .94);
    color: #e8d9bd;
    font: inherit;
    font-size: 12px;
    letter-spacing: .06em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(15, 15, 13, .15);
    transition: background .2s, border-color .2s;
}
.soundtrack[hidden] { display: none; }
.soundtrack:hover { background: #353128; border-color: #d0b98f; }
.soundtrack:focus-visible { outline: 2px solid #e8d9bd; outline-offset: 4px; }
.soundtrack:disabled { cursor: wait; }
.soundtrack__waves { display: none; }
.soundtrack[aria-pressed="true"] .soundtrack__waves { display: inline; }
.soundtrack[aria-pressed="true"] .soundtrack__slash { display: none; }
/* Keep one audio document alive while each public page runs independently. */
body.soundtrack-shell { overflow: hidden !important; height: 100dvh; }
body.soundtrack-shell > :not(#soundtrack-page):not(#soundtrack-toggle):not(#soundtrack-credit) { display: none !important; }
#soundtrack-credit {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: max(20px, env(safe-area-inset-left));
    z-index: 100;
    max-width: calc(100vw - 40px);
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(25, 25, 23, .94);
    color: #e8d9bd;
    font-size: 10px;
    line-height: 1.6;
}
#soundtrack-credit[hidden] { display: none; }
#soundtrack-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#soundtrack-credit a:focus-visible { outline: 2px solid #e8d9bd; outline-offset: 2px; }
#soundtrack-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 99;
    background: #191917;
}
#soundtrack-page.soundtrack-page-pending { visibility: hidden; pointer-events: none; }
@media (max-width: 767px) {
    .soundtrack { left: max(12px, env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); }
}
/* Music is on but the browser is waiting for a first tap: invite it. */
.soundtrack--waiting { animation: soundtrack-invite 2s ease-in-out infinite; }
@keyframes soundtrack-invite {
    0%, 100% { box-shadow: 0 4px 20px rgba(15, 15, 13, .15), 0 0 0 0 rgba(208, 185, 143, .5); }
    50% { box-shadow: 0 4px 20px rgba(15, 15, 13, .15), 0 0 0 8px rgba(208, 185, 143, 0); }
}
@media (prefers-reduced-motion: reduce) { .soundtrack--waiting { animation: none; } }
