body {
    background: #222222 url("logos/sc-logo-45.png") repeat;
    background-size: 200px 200px;
    color: #e0e0e0;
    font-family: 'Playfair Display', Georgia, serif;
    max-width: 1470px;
    margin: 0 auto;
    padding: 64px 20px 100px; /* top = height of the top bar, bottom keeps cards clear of the player bar */
}

/* ---------- Top bar ---------- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: #151515;
    border-bottom: 1px solid #ffb7c5;
}

.tb-left, .tb-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tb-menu {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    cursor: pointer;
}
.tb-menu:hover { border-color: #ffb7c5; color: #ffb7c5; }

.tb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.tb-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #ffb7c5;
}
.tb-logo img { width: 28px; height: 28px; object-fit: contain; }

.tb-text strong { display: block; color: #fff; font-size: 1rem; letter-spacing: 1px; }
.tb-text small { display: block; color: #888; font-size: 0.65rem; letter-spacing: 2px; text-transform: uppercase; }

.tb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.tb-link:hover { color: #ffb7c5; }

.tb-avatar {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ffb7c5;
    background: #1a1a1a;
    box-shadow: 0 0 12px rgba(255, 183, 197, 0.35);
    cursor: pointer;
}
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 700px) {
    body { padding-top: 56px; }
    #top-bar { height: 56px; padding: 0 12px; }
    .tb-link span { display: none; }
}

h1, h2, h3 {
    color: #ffb7c5; /* Sabrina Pastel Pink */
    letter-spacing: 1px;
    margin-top: 0;
}


header {
    padding: 30px 20px;
    border-radius: 4px;
    margin-top: 20px;
    background-color: #1a1a1a;
    border: 1px solid #ffb7c5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discord-link {
    color: #ffb7c5;
    font-weight: bold;
    transition: color 0.15s ease-in-out;
}

.discord-link:hover {
    color: #ffd5dd;
}

.header-text-group {
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
}

.header-img {
    max-width: 240px;
    border: 1px solid #ffb7c5;
    height: auto;
    flex-shrink: 0;
    border-radius: 4px;
    margin-right: 20px;
}

header p {
    color: #888;
    font-size: 1.5rem;
}

hr {
    border: 0;
    border-top: 1px solid #2d2d2d;
    margin: 25px 0;
}

#stats-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stat-box {
    flex: 1;
    min-width: 150px;
    background-color: #1a1a1a;
    border: 1px solid #ffb7c5;
    padding: 15px;
    text-align: center;
}

.stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
}

.stat-box p {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}

#filter-section {
    padding: 30px 20px;
    border-radius: 4px;
    margin-top: 20px;
    background-color: #1a1a1a;
    border: 1px solid #ffb7c5;
}   

#filter-section select, 
#filter-section button {
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 12px;
    font-family: inherit;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#filter-section button:hover {
    background-color: #ffb7c5;
    color: #121212;
    border-color: #ffb7c5;
}

#filter-section label {
    font-size: 0.9rem;
    color: #bbb;
    margin-right: 15px;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #2d2d2d;
    background-color: #1a1a1a;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #262626;
}

th {
    background-color: #222;
    color: #ffb7c5;
    font-weight: bold;
    position: sticky;
    top: 0;
    border-bottom: 1px solid #444;
    font-size: 0.9rem;
    text-transform: uppercase;
}

tr:nth-child(even) {
    background-color: #161616;
}

tr:hover {
    background-color: #222;
}

/* Table Interaction Action Buttons */
td button {
    background-color: transparent;
    color: #ffb7c5;
    border: 1px solid #ffb7c5;
    padding: 4px 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

td button:hover:not(:disabled) {
    background-color: #ffb7c5;
    color: #121212;
}

td button:disabled {
    color: #444;
    border-color: #2d2d2d;
    cursor: not-allowed;
}   

/* ---------- Added: search, tabs, rows ---------- */
.filter-row {
    margin-bottom: 12px;
}

#filter-section input[type="search"] {
    background-color: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 12px;
    font-family: inherit;
    width: min(100%, 360px);
    margin-right: 10px;
}

#filter-section input[type="search"]:focus,
#filter-section select:focus,
#filter-section button:focus-visible,
td button:focus-visible {
    outline: 2px solid #ffb7c5;
    outline-offset: 2px;
}

#tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

#filter-section #tabs .tab {
    margin: 0;
    background-color: transparent;
    border-color: #2d2d2d;
    color: #bbb;
}

#filter-section #tabs .tab.active {
    background-color: #ffb7c5;
    border-color: #ffb7c5;
    color: #121212;
}

#filter-section label.check {
    display: inline-block;
    margin-right: 15px;
}

tr.heard td:first-child::after {
    content: " (heard)";
    color: #666;
    font-size: 0.8rem;
}

tr.picked {
    outline: 2px solid #ffb7c5;
    outline-offset: -2px;
    background-color: #2a1f22;
}

#empty-message {
    padding: 20px;
    color: #888;
    margin: 0;
}

@media (max-width: 600px) {
    body { padding: 12px; }
    th, td { padding: 10px 8px; font-size: 0.85rem; }
}

#song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

.song-card {
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    border: 1px solid #2d2d2d;
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border-color 0.25s ease-out;
}

.song-card:hover {
    transform: translateY(-6px);
    border-color: #ffb7c5;
    box-shadow: 0 0 0 1px #ffb7c5, 0 10px 20px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .song-card { transition: none; }
    .song-card:hover { transform: none; }
}

.cover {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #222;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    background-color: #ffb7c5;
    color: #121212;
}

.badge.unreleased {
    background-color: #121212;
    color: #ffb7c5;
    border: 1px solid #ffb7c5;
}

.card-body {
    padding: 15px;
    flex: 1;
}

.card-body h3 {
    margin: 0 0 4px 0;
}

.artist {
    margin: 0 0 12px 0;
    color: #888;
    font-size: 0.85rem;
}

.info {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.song-card details {
    border-top: 1px solid #2d2d2d;
    padding: 8px 0;
    font-size: 0.85rem;
}

.song-card summary {
    cursor: pointer;
}

.song-card details p {
    margin: 8px 0 0 0;
    color: #bbb;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-top: 1px solid #2d2d2d;
}

.heard {
    font-size: 0.85rem;
    color: #888;
}

.card-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.play-btn {
    background-color: transparent;
    color: #ffb7c5;
    border: 1px solid #ffb7c5;
    padding: 6px 16px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.play-btn:disabled {
    color: #444;
    border-color: #2d2d2d;
    background-color: transparent;
    cursor: not-allowed;
}

.play-btn:hover,
.play-btn.playing {
    background-color: #ffb7c5;
    color: #121212;
}

/* ---------- Bottom player bar ---------- */
body {
    padding-bottom: 100px; /* keeps the last cards from hiding behind the bar */
}

/* ---------- Bottom player bar ---------- */
#player-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr minmax(300px, 2fr) 1fr;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background-color: #1a1a1a;
    border-top: 1px solid #ffb7c5;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.now-playing img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #222;
    border: 1px solid #2d2d2d;
}

.np-text {
    min-width: 0;
}

.np-text strong,
.np-text span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-text strong { color: #fff; }
.np-text span { font-size: 0.8rem; color: #888; }

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.controls button {
    background-color: transparent;
    color: #e0e0e0;
    border: 0;
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
}

.controls button:hover { color: #ffb7c5; }

.controls button.main {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffb7c5;
    color: #121212;
}

.controls button.main:hover { background-color: #fff; color: #121212; }

.progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 0.75rem;
    color: #888;
}

.player-right {
    display: flex;
    justify-content: flex-end;
}

.volume {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #888;
}

.volume input { width: 100px; }

/* pink, filled sliders instead of the default gray ones */
#player-bar input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    background: linear-gradient(to right, #ffb7c5 var(--fill, 0%), #3a3a3a var(--fill, 0%));
}

#player-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ffb7c5;
    border: 0;
}

#player-bar input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ffb7c5;
    border: 0;
}

@media (max-width: 700px) {
    body { padding-bottom: 165px; }
    #player-bar { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 8px 14px; }
    .player-center { display: contents; }
    .progress { grid-column: 1 / -1; }
    .player-right { grid-column: 1 / -1; justify-content: space-between; }
    .vol-pop { left: 0; right: auto; width: min(230px, 80vw); }
}

@media (max-width: 700px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-text-group,
    header p {
        font-size: 1rem;
    }

    .header-text-group h1 {
        font-size: 1.8rem;
    }

    .header-img {
        width: 100%;
        max-width: 220px;
        margin-right: 0;
        align-self: center;
    }
}

/* hide the player bar until a song is played */
#player-bar:not(.active) {
    display: none;
}

/* highlight for the Surprise Me button */
.song-card.picked {
    border-color: #ffb7c5;
    box-shadow: 0 0 0 2px #ffb7c5;
}

/* greyed-out button for songs with no audio file */
.play-btn:disabled {
    color: #444;
    border-color: #2d2d2d;
    background-color: transparent;
    cursor: not-allowed;
}

.controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.controls button.main {
    padding: 0;
}

.controls .icon-pause {
    display: none;
}

.controls .main.is-playing .icon-pause {
    display: block;
}

.controls .main.is-playing .icon-play {
    display: none;
}

.icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- Mini bar: volume popover, Player, Download ---------- */
.player-right { align-items: center; gap: 10px; }

.bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 8px;
}
.bar-btn:hover { color: #ffb7c5; }

.vol-wrap { position: relative; }

.vol-pop {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 230px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #1a1a1a;
    border: 1px solid #ffb7c5;
    color: #bbb;
    font-size: 0.8rem;
}
.vol-pop[hidden] { display: none; }
.vol-pop input[type="range"] { width: 110px; }

/* ---------- Big player ---------- */
.fp {
    position: fixed;
    inset: 5vh 6vw;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.65);
    z-index: 200;
    display: grid;
    grid-template-columns: 1fr 420px;
    background: radial-gradient(circle at 30% 30%, #2a1a1e 0%, #121212 60%);
    border: 1px solid #ffb7c5;
    overflow: hidden;
}
.fp[hidden] { display: none; }

.fp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: transparent;
    border: 0;
    color: #bbb;
    cursor: pointer;
}
.fp-close:hover { color: #ffb7c5; }

.fp-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 40px;
    text-align: center;
}

.fp-pill {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 183, 197, 0.1);
    color: #ffb7c5;
    border: 1px solid #ffb7c5;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.fp-art img {
    width: min(300px, 40vh);
    height: min(300px, 40vh);
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #ffb7c5;
    box-shadow: 0 0 60px rgba(255, 183, 197, 0.35);
    transition: border-radius 0.3s ease;
}
.fp.square .fp-art img { border-radius: 6px; }

.fp-main h2 { font-size: 2rem; color: #fff; margin: 28px 0 6px; }
.fp-main p { margin: 0 0 12px; color: #888; }

.fp-tags { display: flex; gap: 10px; align-items: center; color: #888; font-size: 0.8rem; text-transform: uppercase; }
.fp-badge { border: 1px solid #ffb7c5; color: #ffb7c5; padding: 2px 8px; }

.fp-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(540px, 100%);
    margin: 36px 0 24px;
    font-size: 0.75rem;
    color: #888;
}

.fp-controls { display: flex; align-items: center; gap: 22px; }

.fp-small, .fp-big {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}
.fp-small { width: 34px; height: 34px; background: transparent; border: 1px solid #444; color: #e0e0e0; }
.fp-small:hover { border-color: #ffb7c5; color: #ffb7c5; }
.fp-big { width: 64px; height: 64px; background: #ffb7c5; border: 0; color: #121212; }
.fp-big .icon { width: 28px; height: 28px; }
.fp-big .icon-pause { display: none; }
.fp-big.is-playing .icon-pause { display: block; }
.fp-big.is-playing .icon-play { display: none; }

.fp-extras { display: flex; align-items: center; gap: 12px; margin-top: 28px; color: #888; }
.fp-extras input[type="range"] { width: 120px; }

.fp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #444;
    color: #ffb7c5;
    cursor: pointer;
    text-decoration: none;
}
.fp-icon-btn:hover, .fp-icon-btn.on { background: #ffb7c5; color: #121212; border-color: #ffb7c5; }

/* sliders in the big player (same pink style as the bar) */
.fp input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    cursor: pointer;
    background: linear-gradient(to right, #ffb7c5 var(--fill, 0%), #3a3a3a var(--fill, 0%));
}
.fp input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px; border-radius: 50%; background: #ffb7c5; border: 0;
}
.fp input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 50%; background: #ffb7c5; border: 0;
}

/* ---------- Playlist panel ---------- */
.fp-side { border-left: 1px solid #2d2d2d; padding: 24px 20px; overflow-y: auto; background: rgba(0, 0, 0, 0.25); }

.fp-side-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #2d2d2d; }
.fp-side-head small { color: #ffb7c5; font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }
.fp-side-head h3 { margin: 4px 0 0; color: #fff; }
.fp-side-actions { display: flex; gap: 6px; margin-right: 28px; }

.fp-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #444;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0 10px;
    height: 32px;
    cursor: pointer;
}
.fp-text-btn:hover { border-color: #ffb7c5; color: #ffb7c5; }
.fp-text-btn.fp-filled { background: #ffb7c5; border-color: #ffb7c5; color: #121212; }

#fp-playlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.fp-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid #2d2d2d;
    background: #1a1a1a;
}
.fp-item.active { border-color: #ffb7c5; background: linear-gradient(90deg, rgba(255, 183, 197, 0.15), #1a1a1a); }
.fp-item img { width: 48px; height: 48px; object-fit: cover; }
.fp-item-text { min-width: 0; }
.fp-item-text strong, .fp-item-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-item-text strong { color: #fff; font-size: 0.9rem; }
.fp-item-text span { color: #888; font-size: 0.75rem; }
.fp-item-actions { display: flex; gap: 2px; }
.fp-item-actions button { background: transparent; border: 0; color: #888; cursor: pointer; padding: 4px; }
.fp-item-actions button:hover { color: #ffb7c5; }

@media (max-width: 900px) {
    .fp { grid-template-columns: 1fr; overflow-y: auto; }
    .fp-side { border-left: 0; border-top: 1px solid #2d2d2d; }
}

/* spinning cover: the spin is always set up but paused, so pausing the song freezes it at its angle */
.fp-art {
    position: relative;
}

.fp-art img {
    animation: vinyl-spin 14s linear infinite;
    animation-play-state: paused;
}

.fp.spinning .fp-art img {
    animation-play-state: running;
}

/* the square cover option doesn't spin */
.fp.square .fp-art img {
    animation: none;
}

/* small vinyl hole in the middle (delete this block if you don't want it) */

@keyframes vinyl-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .fp-art img { animation: none; }
}

.fp-empty {
    color: #888;
    font-size: 0.85rem;
    padding: 10px 4px;
}

.fp-item {
    cursor: pointer;
}

.fp-item:hover {
    border-color: #ffb7c5;
} 

.fp-side-head { position: relative; }

.fp-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 5;
    background: #1a1a1a;
    border: 1px solid #ffb7c5;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.fp-picker[hidden] { display: none; }

.fp-picker input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    background: #121212;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 10px;
    font-family: inherit;
    margin-bottom: 8px;
}
.fp-picker input[type="search"]:focus { outline: 2px solid #ffb7c5; outline-offset: 1px; }

#fp-picker-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.fp-pick {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px;
    cursor: pointer;
    border-bottom: 1px solid #262626;
}
.fp-pick:hover { background: #222; }
.fp-pick img { width: 40px; height: 40px; object-fit: cover; }
.fp-pick strong, .fp-pick span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-pick strong { color: #fff; font-size: 0.85rem; }
.fp-pick span { color: #888; font-size: 0.75rem; }
.fp-pick .add { color: #ffb7c5; font-size: 0.8rem; }
.fp-pick.added .add { color: #888; }
.fp-pick.noaudio { opacity: 0.4; cursor: not-allowed; }

/* ---------- Big player on phones / narrow screens ---------- */
@media (max-width: 900px) {
    .fp-pill { right: 52px; }
    .fp-side-actions { margin-right: 0; }
}

@media (max-width: 700px) {
    .fp { inset: 0; box-shadow: none; }
    .fp-main { padding: 56px 16px 24px; }
}

/* ---------- Side menu ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 240;
    background: rgba(0, 0, 0, 0.6);
}
.drawer-backdrop[hidden] { display: none; }

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 250;
    width: min(380px, 88vw);
    background: #121212;
    border-right: 1px solid #ffb7c5;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
    position: relative;
    padding: 22px 20px 16px;
    border-bottom: 1px solid #2d2d2d;
}
.drawer-brand { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.drawer-brand img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.drawer-brand strong { color: #fff; font-size: 1.05rem; letter-spacing: 1px; line-height: 1.3; }
.drawer-head p { margin: 14px 0 0; color: #888; font-size: 0.85rem; }

.drawer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #ffb7c5;
    color: #ffb7c5;
    cursor: pointer;
}
.drawer-close:hover { background: #ffb7c5; color: #121212; }

.drawer-nav { padding: 14px 12px; }
.drawer-nav small {
    display: block;
    margin: 14px 8px 8px;
    color: #777;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.drawer-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
    padding: 14px 12px;
    background: transparent;
    border: 0;
    border-left: 3px solid transparent;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}
.drawer-item:hover { background: #1a1a1a; }
.drawer-item.active {
    background: rgba(255, 183, 197, 0.12);
    border-left-color: #ffb7c5;
    color: #ffb7c5;
}
.drawer-item.locked { opacity: 0.55; cursor: not-allowed; }
.drawer-item.locked:hover { background: transparent; }

.needs-account {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: normal;
    color: #aaa;
    border: 1px solid #444;
    padding: 2px 8px;
}
.needs-account .icon { width: 12px; height: 12px; }

/* ---------- Make a playlist popup ---------- */
.pl-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
}
.pl-modal[hidden] { display: none; }

.pl-box {
    width: min(520px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #ffb7c5;
    padding: 20px;
}

.pl-head { position: relative; margin-bottom: 16px; padding-right: 40px; }
.pl-head small { color: #ffb7c5; font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }
.pl-head h3 { margin: 4px 0 0; color: #fff; }
.pl-head .drawer-close { top: 0; right: 0; }

.pl-step { display: flex; flex-direction: column; min-height: 0; }
.pl-step[hidden] { display: none; }

.pl-step input[type="search"],
.pl-step input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: #121212;
    color: #fff;
    border: 1px solid #444;
    padding: 9px 12px;
    font-family: inherit;
    margin-bottom: 10px;
}
.pl-step input[type="search"]:focus,
.pl-step input[type="text"]:focus { outline: 2px solid #ffb7c5; outline-offset: 1px; }
.pl-step label { color: #bbb; font-size: 0.85rem; margin-bottom: 6px; }

#pl-results {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    overflow-y: auto;
    max-height: 340px;
    border: 1px solid #2d2d2d;
}

.pl-pick {
    display: grid;
    grid-template-columns: 22px 40px 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #262626;
    cursor: pointer;
}
.pl-pick:hover { background: #222; }
.pl-pick.selected { background: rgba(255, 183, 197, 0.1); }
.pl-pick input { accent-color: #ffb7c5; width: 16px; height: 16px; }
.pl-pick img { width: 40px; height: 40px; object-fit: cover; }
.pl-pick strong, .pl-pick span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-pick strong { color: #fff; font-size: 0.9rem; }
.pl-pick span { color: #888; font-size: 0.75rem; }

.pl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pl-foot-right { display: flex; gap: 8px; }
#pl-count { color: #888; font-size: 0.85rem; }

.pl-btn {
    background: transparent;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 8px 16px;
    font-family: inherit;
    cursor: pointer;
}
.pl-btn:hover { border-color: #ffb7c5; color: #ffb7c5; }
.pl-btn.filled { background: #ffb7c5; border-color: #ffb7c5; color: #121212; }
.pl-btn.filled:hover { background: #fff; border-color: #fff; color: #121212; }
.pl-btn:disabled { background: transparent; border-color: #2d2d2d; color: #555; cursor: not-allowed; }

.pl-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 4px 0 18px;
    color: #888;
    font-size: 0.8rem;
}
.pl-note .icon { width: 14px; height: 14px; margin-top: 2px; }

.pl-pick.noaudio { opacity: 0.4; cursor: not-allowed; }

/* ---------- 24/7 Radio ---------- */
.on-air {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 4px 14px;
    border: 1px solid #ffb7c5;
    color: #ffb7c5;
    font-size: 0.75rem;
    letter-spacing: 3px;
}
.on-air .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5a7a;
    animation: onair-pulse 1.4s ease-in-out infinite;
}
@keyframes onair-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 90, 122, 0.6); }
    50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(255, 90, 122, 0); }
}

.radio-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(540px, 100%);
    margin: 32px 0 20px;
    font-size: 0.75rem;
    color: #888;
}
.radio-bar { flex: 1; height: 4px; border-radius: 2px; background: #3a3a3a; overflow: hidden; }
#radio-fill { height: 100%; width: 0; background: #ffb7c5; }

.radio-vol { display: flex; align-items: center; gap: 12px; color: #888; }
.radio-vol input { width: 140px; flex: none; }

.radio-note { max-width: 420px; margin: 22px 0 0; color: #777; font-size: 0.8rem; }
#radio-start { margin-top: 18px; }

.radio .fp-item { cursor: default; }
.radio .fp-item:hover { border-color: #2d2d2d; }
.radio .fp-item.active:hover { border-color: #ffb7c5; }
.radio-in { color: #888; font-size: 0.75rem; white-space: nowrap; padding-right: 6px; }

@media (prefers-reduced-motion: reduce) {
    .on-air .dot { animation: none; }
}

/* ---------- Accounts ---------- */
.pl-step input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    background: #121212;
    color: #fff;
    border: 1px solid #444;
    padding: 9px 12px;
    font-family: inherit;
    margin-bottom: 10px;
}
.pl-step input[type="password"]:focus { outline: 2px solid #ffb7c5; outline-offset: 1px; }

.pl-note[hidden], .auth-error[hidden] { display: none; }
.auth-error { margin: 0 0 14px; color: #ff8a9b; font-size: 0.85rem; }

.pl-btn.danger:hover { border-color: #ff8a9b; color: #ff8a9b; }
.pl-btn:disabled { cursor: not-allowed; }

.tb-avatar.signed-in { box-shadow: 0 0 0 2px #ffb7c5, 0 0 14px rgba(255, 183, 197, 0.5); }

.acct-menu {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 95;
    width: 230px;
    background: #1a1a1a;
    border: 1px solid #ffb7c5;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.acct-menu[hidden] { display: none; }
.acct-name { margin: 4px 6px 10px; color: #888; font-size: 0.8rem; }
.acct-name strong { color: #fff; }
.acct-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #e0e0e0;
    font-family: inherit;
    padding: 10px 8px;
    cursor: pointer;
}
.acct-menu button:hover { background: #222; color: #ffb7c5; }

.mypl-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 360px; border: 1px solid #2d2d2d; }
.mypl-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #262626;
}
.mypl-item strong { display: block; color: #fff; }
.mypl-item span { color: #888; font-size: 0.75rem; }
.mypl-actions { display: flex; gap: 6px; }
.mypl-actions .pl-btn { padding: 6px 12px; font-size: 0.8rem; }

@media (max-width: 700px) {
    .acct-menu { top: 62px; right: 12px; }
}

/* ---------- Avatar: generic user when signed out, initial when signed in ---------- */
.tb-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffb7c5;
}
.tb-avatar .avatar-icon { width: 24px; height: 24px; }
.tb-avatar .avatar-initial { display: none; font-weight: bold; font-size: 1.1rem; color: #121212; }
.tb-avatar.signed-in { background: #ffb7c5; }
.tb-avatar.signed-in .avatar-icon { display: none; }
.tb-avatar.signed-in .avatar-initial { display: block; }

.drawer-item.locked { cursor: pointer; }
.drawer-item:not(.locked) .needs-account { display: none; }

/* ---------- Full pages (Listening Stats, Profile) ---------- */
.page-view {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #141414;
    padding: 28px 20px 130px;
}
.page-view[hidden] { display: none; }
.page-inner { max-width: 1150px; margin: 0 auto; }

.page-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    background: transparent;
    border: 0;
    color: #888;
    font-family: inherit;
    cursor: pointer;
}
.page-back:hover { color: #ffb7c5; }

.eyebrow { margin: 0; color: #ffb7c5; font-size: 0.75rem; letter-spacing: 4px; text-transform: uppercase; }
.page-title {
    margin: 8px 0 10px;
    color: #fff;
    font-size: clamp(2.2rem, 6vw, 4rem);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.page-sub { margin: 0; color: #999; font-size: 0.9rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #ffb7c5;
    color: #ffb7c5;
    padding: 10px 16px;
    font-family: inherit;
    cursor: pointer;
}
.page-btn:hover { background: #ffb7c5; color: #121212; }

.period-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 26px 0; }
.period-tabs { display: inline-flex; border: 1px solid #ffb7c5; }
.period-tab {
    background: transparent;
    border: 0;
    color: #ddd;
    padding: 12px 18px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}
.period-tab.active { background: #ffb7c5; color: #121212; }
#stats-month, #stats-year {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    padding: 12px 14px;
    font-family: inherit;
    color-scheme: dark;
}
.period-note { color: #777; font-size: 0.8rem; }
.stats-msg { color: #bbb; margin: 0 0 18px; }
.stats-msg[hidden] { display: none; }

.summary-card { background: #1a1215; border: 1px solid #ffb7c5; padding: 26px 28px; margin-bottom: 28px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 20px; }
.summary-grid .icon { width: 26px; height: 26px; color: #ffb7c5; }
.summary-grid strong { display: block; color: #fff; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 8px 0 4px; }
.summary-grid span { color: #aaa; font-size: 0.85rem; }

.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.rank-card { background: #1a1a1a; border: 1px solid #2d2d2d; padding: 24px; margin-bottom: 0; }
.rank-card h2 { margin: 0 0 14px; color: #fff; text-transform: uppercase; font-size: 1.3rem; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #262626;
}
.rank-row:first-child { border-top: 0; }
.rank-n { color: #ffb7c5; font-weight: bold; }
.rank-row strong { display: block; color: #fff; }
.rank-row div span { color: #888; font-size: 0.8rem; }
.rank-plays { color: #aaa; font-size: 0.85rem; white-space: nowrap; }
.rank-empty { color: #777; padding: 10px 0; }

.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ach { border: 1px solid #2d2d2d; padding: 14px; opacity: 0.45; }
.ach strong { display: block; color: #fff; margin-bottom: 4px; }
.ach span { color: #888; font-size: 0.8rem; }
.ach.earned { opacity: 1; border-color: #ffb7c5; background: rgba(255, 183, 197, 0.08); }
.ach.earned strong { color: #ffb7c5; }

.profile-card { display: flex; align-items: center; gap: 24px; margin-top: 24px; padding: 28px; background: #1a1a1a; border: 1px solid #2d2d2d; }
.profile-avatar {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffb7c5;
    color: #121212;
    font-size: 2.6rem;
    font-weight: bold;
    box-shadow: 0 0 24px rgba(255, 183, 197, 0.4);
}
.profile-card h2 { margin: 0 0 6px; color: #fff; font-size: 1.8rem; }

@media (max-width: 900px) {
    .rank-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .page-view { top: 56px; padding: 20px 14px 190px; }
    .summary-card { padding: 20px 16px; }
    .profile-card { flex-direction: column; text-align: center; }
}

/* ---------- Track number, hearts on cards ---------- */
.track-no {
    margin: 0 0 6px;
    color: #ffb7c5;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fav-btn {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    color: #888;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
}
.fav-btn:hover, .fav-btn.on { color: #ffb7c5; }

/* top bar picture */
.tb-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-avatar.has-image .avatar-icon, .tb-avatar.has-image .avatar-initial { display: none; }

/* ---------- Profile page ---------- */
.profile-view { --pf: #ffb7c5; }
.profile-view .page-btn { border-color: var(--pf); color: var(--pf); }
.profile-view .page-btn:hover { background: var(--pf); color: #121212; }

.pf-header { border: 1px solid var(--pf); background: #101014; }
.pf-banner {
    height: clamp(130px, 22vw, 250px);
    background: linear-gradient(135deg, var(--pf), #1a1215 75%) center / cover no-repeat;
}
.pf-info { display: flex; align-items: flex-start; gap: 24px; padding: 0 28px 24px; flex-wrap: wrap; }
.pf-avatar {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    margin-top: -56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 3px solid var(--pf);
    background: #1a1a1a;
    color: var(--pf);
    font-size: 2.8rem;
    font-weight: bold;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.12);
}
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-text { flex: 1; min-width: 220px; padding-top: 16px; }
.pf-name { margin: 0; color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0; }
.pf-handle { margin: 4px 0 12px; color: #999; font-size: 0.9rem; }
.pf-bio { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--pf); color: #ddd; font-style: italic; }
.pf-bio[hidden] { display: none; }
.pf-joined { margin: 0; color: #888; font-size: 0.8rem; }
.pf-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 18px; }

.pf-fav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 22px 0;
    max-width: 560px;
    padding: 14px 16px;
    border: 1px solid var(--pf);
    background: #11141a;
}
.pf-fav img { width: 64px; height: 64px; object-fit: cover; flex-shrink: 0; }
.pf-fav-text { flex: 1; min-width: 0; }
.pf-fav-text small { display: block; color: #aaa; font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }
.pf-fav-text strong { display: block; color: #fff; font-size: 1.2rem; margin: 4px 0 2px; }
.pf-fav-text span { color: #999; font-size: 0.85rem; }
.pf-fav-empty { margin: 0; color: #888; font-size: 0.9rem; }
.pf-play {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pf);
    border: 0;
    color: #121212;
    cursor: pointer;
}
.pf-play:disabled { background: #333; color: #666; cursor: not-allowed; }

.pf-tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid #2d2d2d; margin-bottom: 20px; }
.pf-tab {
    background: transparent;
    border: 0;
    color: #bbb;
    padding: 12px 20px;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
}
.pf-tab.active { background: var(--pf); color: #121212; }

.pf-list { list-style: none; margin: 0; padding: 0; border: 1px solid #2d2d2d; background: #14161b; }
.pf-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #262626;
}
.pf-row:last-child { border-bottom: 0; }
.pf-row-plain { grid-template-columns: 1fr auto; }
.pf-row img { width: 48px; height: 48px; object-fit: cover; }
.pf-row strong { display: block; color: #fff; }
.pf-row span { color: #888; font-size: 0.8rem; }
.pf-row-actions { display: flex; align-items: center; gap: 8px; }
.pf-empty { padding: 22px 16px; color: #888; }

/* ---------- Edit profile and Appearance ---------- */
.ed-scroll { overflow-y: auto; padding-right: 4px; }
.pl-step select {
    width: 100%;
    box-sizing: border-box;
    background: #121212;
    color: #fff;
    border: 1px solid #444;
    padding: 9px 12px;
    font-family: inherit;
    margin-bottom: 10px;
}
.ed-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ed-avatar {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #222;
    border: 1px solid #444;
    color: #ffb7c5;
    font-size: 1.6rem;
    font-weight: bold;
}
.ed-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-banner { width: 160px; height: 40px; background: #222 center / cover no-repeat; border: 1px solid #444; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: #fff; }

@media (max-width: 700px) {
    .pf-info { padding: 0 16px 20px; }
    .pf-avatar { width: 92px; height: 92px; margin-top: -46px; font-size: 2.2rem; }
    .pf-actions { padding-top: 0; }
    .pf-row { grid-template-columns: 44px 1fr; }
    .pf-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .pf-row-plain { grid-template-columns: 1fr; }
    .pf-tab { padding: 10px 14px; }
}
