/* Playlist "Artist Merge" mini-game (2048-style) — overlay on the /playlist/ hero. */

/* Full-page canvas: strip the glass card so the playlist reads edge-to-edge. */
.fsa-mm-playlist-panel {
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
}
.fsa-mm-playlist-bar {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding: 12px clamp(16px, 3vw, 36px) !important;
}
.fsa-mm-playlist-groups {
    padding: 18px clamp(16px, 3vw, 36px) 0;
}

.fsa-mm-playlist-player--hero {
    position: relative;
    border-radius: 0 !important;
}
.fsa-mm-playlist-player--hero.is-game-mode {
    min-height: 68vh;
}
@media (max-width: 780px) {
    .fsa-mm-playlist-player--hero.is-game-mode {
        min-height: 60vh;
    }
    .fsa-mm-playlist-groups {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* In game mode the visualizer canvas steps aside (audio keeps playing). */
.fsa-mm-playlist-player--hero.is-game-mode .fsa-mm-viz-embed {
    visibility: hidden;
}

.fsa-mm-playlist-game {
    position: absolute;
    inset: 0;
    display: none;
    z-index: 4;
    border-radius: inherit;
    overflow: hidden;
    touch-action: none;
    background:
        radial-gradient(circle at 50% 18%, rgba(88, 101, 242, 0.20), rgba(5, 7, 13, 0) 62%),
        linear-gradient(180deg, rgba(9, 12, 22, 0.35), rgba(5, 7, 13, 0.55));
}
.fsa-mm-playlist-player--hero.is-game-mode .fsa-mm-playlist-game {
    display: block;
}
.fsa-mm-playlist-game-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    touch-action: none;
}

.fsa-mm-playlist-game-hud {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
    z-index: 5;
}
.fsa-mm-playlist-game-scores {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #c6d4ef;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}
.fsa-mm-playlist-game-scores b {
    color: #eaf1ff;
    font-size: 17px;
    font-weight: 800;
}
.fsa-mm-playlist-game-scores [data-game-combo] {
    color: #ffd27a;
}
.fsa-mm-playlist-game-scores [data-game-combo] b {
    color: #ffb638;
}
.fsa-mm-playlist-game-hint {
    margin: 0;
    max-width: 250px;
    font-size: 12px;
    line-height: 1.4;
    color: #c6d4ef;
    text-align: right;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
    transition: opacity 0.5s ease;
}
.fsa-mm-playlist-game-hint.is-faded {
    opacity: 0;
}

/* ---- Compact control dock (replaces the old playlist bar controls) ---- */
.fsa-mm-playlist-dock {
    align-items: center;
    gap: 12px;
}
.fsa-mm-playlist-dock-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Hero experience selector: one dropdown for Game + visualizer styles. */
.fsa-mm-playlist-exp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.fsa-mm-playlist-exp-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(220, 230, 255, 0.5);
}
.fsa-mm-playlist-exp-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.06);
    color: #eaf1ff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 8px 32px 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6d4ef' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 11px;
}
.fsa-mm-playlist-exp-select:hover {
    border-color: rgba(138, 180, 255, 0.5);
}
.fsa-mm-playlist-exp-select:focus-visible {
    outline: 2px solid #5865f2;
    outline-offset: 1px;
}
.fsa-mm-playlist-exp-select option {
    color: #10131c;
}

/* Kept in the DOM only so the player's visualizer keeps its style hook. */
.fsa-mm-playlist-viz-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Transport: small round icon controls. */
.fsa-mm-playlist-transport {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.fsa-mm-playlist-ctl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #eaf1ff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.fsa-mm-playlist-ctl:hover {
    background: rgba(255, 255, 255, 0.12);
}
.fsa-mm-playlist-ctl:active {
    transform: scale(0.94);
}
.fsa-mm-playlist-ctl svg {
    width: 17px;
    height: 17px;
    display: block;
    margin: auto;
}
.fsa-mm-playlist-ctl[data-dock-play] {
    background: #5865f2;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.45);
}
.fsa-mm-playlist-ctl[data-dock-play]:hover {
    background: #6b78ff;
}
.fsa-mm-playlist-ctl .fsa-mm-playlist-ctl-pause {
    display: none;
}
.fsa-mm-playlist-ctl.is-playing .fsa-mm-playlist-ctl-play {
    display: none;
}
.fsa-mm-playlist-ctl.is-playing .fsa-mm-playlist-ctl-pause {
    display: block;
}
.fsa-mm-playlist-ctl.fsa-mm-playlist-toggle.is-on {
    background: #5865f2;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
}

/* Volume: icon + slider. Slider inline on desktop, collapses behind the icon on mobile. */
.fsa-mm-playlist-vol {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.fsa-mm-playlist-vol-slider {
    width: 84px;
    accent-color: #5865f2;
    cursor: pointer;
}
@media (max-width: 780px) {
    .fsa-mm-playlist-vol-slider {
        width: 0;
        opacity: 0;
        pointer-events: none;
        transition: width 0.2s ease, opacity 0.2s ease;
    }
    .fsa-mm-playlist-vol.is-open .fsa-mm-playlist-vol-slider {
        width: 84px;
        opacity: 1;
        pointer-events: auto;
    }
    .fsa-mm-playlist-transport {
        gap: 6px;
    }
    .fsa-mm-playlist-ctl {
        width: 30px;
        height: 30px;
    }
}

/* ---- Bottom "now playing" bar (single track + transport, moved down here) ---- */
.fsa-mm-playlist-nowbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px clamp(16px, 3vw, 36px);
    background: linear-gradient(180deg, rgba(10, 14, 26, 0), rgba(8, 11, 20, 0.6));
}
.fsa-mm-playlist-now {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}
.fsa-mm-playlist-now-thumb {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #8ea6d6;
    font-size: 18px;
}
.fsa-mm-playlist-now-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fsa-mm-playlist-now-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.fsa-mm-playlist-now-song {
    color: #eaf1ff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fsa-mm-playlist-now-artist {
    color: #9fb2d8;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fsa-mm-playlist-queue-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #c6d4ef;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.fsa-mm-playlist-queue-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #eaf1ff;
}
.fsa-mm-playlist-queue-toggle.is-open {
    background: #5865f2;
    border-color: transparent;
    color: #fff;
}
.fsa-mm-playlist-queue-toggle svg {
    width: 16px;
    height: 16px;
}
.fsa-mm-playlist-nowbar .fsa-mm-playlist-transport {
    flex: 0 0 auto;
    margin-left: auto;
}
.fsa-mm-playlist-nowbar .fsa-mm-playlist-exp {
    flex: 0 0 auto;
}

/* Icons inherit color via currentColor — the theme was tinting them red. Force. */
.fsa-mm-playlist-wrap .fsa-mm-playlist-ctl {
    color: #eaf1ff !important;
}
.fsa-mm-playlist-wrap .fsa-mm-playlist-ctl[data-dock-play],
.fsa-mm-playlist-ctl.fsa-mm-playlist-toggle.is-on {
    color: #fff !important;
}
.fsa-mm-playlist-wrap .fsa-mm-playlist-queue-toggle {
    color: #c6d4ef !important;
}
.fsa-mm-playlist-now-song {
    color: #eaf1ff !important;
}
.fsa-mm-playlist-now-artist {
    color: #9fb2d8 !important;
}
.fsa-mm-playlist-exp-select {
    color: #eaf1ff !important;
}

/* When expanded, the full queue scrolls instead of pushing the page down. */
.fsa-mm-playlist-groups[data-playlist-queue] {
    max-height: 44vh;
    overflow-y: auto;
}

/* ---- Beat the active theme (e.g. Blocksy) that skins every <button> with a
   rounded-rect + accent-colored border/outline. Force clean round icons. ---- */
.fsa-mm-playlist-nowbar .fsa-mm-playlist-ctl,
.fsa-mm-playlist-bar .fsa-mm-playlist-ctl {
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 50% !important;
    outline: none !important;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}
.fsa-mm-playlist-nowbar .fsa-mm-playlist-ctl[data-dock-play],
.fsa-mm-playlist-bar .fsa-mm-playlist-ctl[data-dock-play] {
    background-color: #5865f2 !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.45);
}
.fsa-mm-playlist-ctl.fsa-mm-playlist-toggle.is-on {
    background-color: #5865f2 !important;
    border-color: transparent !important;
    color: #fff !important;
}
.fsa-mm-playlist-queue-toggle {
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 9px !important;
    outline: none !important;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}
.fsa-mm-playlist-queue-toggle.is-open {
    background-color: #5865f2 !important;
    border-color: transparent !important;
}
.fsa-mm-playlist-ctl:focus-visible,
.fsa-mm-playlist-queue-toggle:focus-visible,
.fsa-mm-playlist-exp-select:focus-visible {
    outline: 2px solid rgba(138, 180, 255, 0.75) !important;
    outline-offset: 2px;
}
.fsa-mm-playlist-exp-select {
    outline: none;
    box-shadow: none;
}

/* ---- Phones: drop the page title/subtitle + bar labels for a cleaner, bigger
   game surface. Keep just the Hero dropdown + transport. ---- */
@media (max-width: 780px) {
    .fsa-mm-playlist-hero {
        display: none !important;
    }
    .fsa-mm-playlist-exp-label,
    .fsa-mm-playlist-bar-count {
        display: none !important;
    }
    .fsa-mm-playlist-bar {
        padding: 8px clamp(12px, 3vw, 20px) !important;
    }
    .ssp-playlist-page .fsa-mm-playlist-wrap {
        padding-top: 8px !important;
    }
    .fsa-mm-playlist-player--hero.is-game-mode {
        min-height: 70vh;
    }
}

/* ---- Force uniform round transport icons (beat theme min-width/padding/radius
   that stretch some into pills) and tidy the mobile now-bar. ---- */
.fsa-mm-playlist-wrap .fsa-mm-playlist-ctl {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    flex: 0 0 auto;
    box-shadow: none !important;
    line-height: 0 !important;
}
/* Optically center the naturally left-weighted speaker glyph. */
.fsa-mm-playlist-ctl[data-dock-vol] svg {
    transform: translateX(2px);
}
.fsa-mm-playlist-wrap .fsa-mm-playlist-queue-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    flex: 0 0 auto;
    box-shadow: none !important;
}
@media (max-width: 780px) {
    .fsa-mm-playlist-wrap .fsa-mm-playlist-ctl,
    .fsa-mm-playlist-wrap .fsa-mm-playlist-queue-toggle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    /* The game is the focus on phones — drop the now-playing text (the dropdown
       moved down here needs the room) and reclaim the empty bottom space. */
    .fsa-mm-playlist-now {
        display: none;
    }
    .fsa-mm-playlist-nowbar {
        gap: 6px;
        padding: 10px 10px;
    }
    /* Keep the dropdown compact so all four transport buttons (incl. Loop) fit. */
    .fsa-mm-playlist-exp-select {
        max-width: 122px;
        padding: 6px 26px 6px 10px;
        font-size: 12px;
    }
    .fsa-mm-playlist-transport {
        gap: 5px;
    }
    .ssp-playlist-page .fsa-mm-playlist-wrap {
        padding-bottom: 40px !important;
    }
}

/* Immersive hero mode reuses the game canvas for the spinning portfolio disc —
   no score/hint HUD in that mode. */
.fsa-mm-playlist-game[data-game-mode="immersive"] .fsa-mm-playlist-game-hud {
    display: none;
}
