/* Right Sidebar Player */
.sfx-player-sidebar {
    position: fixed;
    top: calc(91px + 1.25rem);
    right: 1.5rem;
    left: auto;
    bottom: auto;
    width: 320px;
    max-width: calc(100% - 3rem);
    max-height: calc(100vh - 91px - 2.5rem);
    z-index: 1000;
    background: rgba(10, 8, 6, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    transition: all 0.4s ease;
}

.active-sounds-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.active-sounds-container::-webkit-scrollbar {
    width: 4px;
}

.active-sounds-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.active-sound-block {
    position: relative;
    background: rgba(10, 8, 6, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 24px;
    max-height: 30px;
    gap: 0.5rem;
    flex-shrink: 0;
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    animation: soundBlockAppear 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top center;
}

.active-sound-block.is-leaving {
    animation: none;
    opacity: 0 !important;
    transform: scale(0.85) translateY(10px);
    min-height: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: -0.15rem; /* Cancels out the flex gap to collapse fully */
    border-width: 0;
    border-color: transparent;
}

@keyframes soundBlockAppear {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.native-audio-block {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    background: rgba(20, 15, 10, 0.5);
    border-color: rgba(200, 154, 83, 0.25);
    max-height: none;
}

.native-audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-sound-cat {
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.active-sound-progress {
    position: absolute;
    left: 0; bottom: 0; top: 0;
    background: rgba(200, 154, 83, 0.2);
    z-index: 0;
    width: 0%;
    pointer-events: none;
}

.active-sound-label {
    position: relative;
    z-index: 1;
    font-size: 0.7rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    color: #F2E4C7;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Ambience Switcher */
.player-ambience-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}

.player-ambience-block .eyebrow {
    margin: 0;
    font-size: 0.65rem;
    text-align: center;
}

.ambience-square {
    display: flex;
    flex-direction: column;
    width: 256px;
    height: 256px;
    max-width: 100%;
    padding: 0.5rem;
    padding-right: 0;
    border-radius: 10px;
    border: 2px solid var(--accent);
    background-size: cover;
    background-position: center;
    transition: all var(--transition);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(200, 154, 83, 0.25);
}

.ambience-switcher-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
}

.ambience-arrow {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ambience-arrow:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.ambience-label {
    font-size: 0.8rem;
    color: #F2E4C7;
    font-family: 'Space Grotesk', sans-serif;
    min-width: 140px;
    text-align: center;
}

.ambience-square[data-ambience="nature"] {
    background-image: url('/images/ambience_dry.jpg');
}

.ambience-square[data-ambience="room"] {
    background-image: url('/images/ambience_room.jpg');
}

.ambience-square[data-ambience="hall"] {
    background-image: url('/images/ambience_hall.jpg');
}

.audio-card__player {
    width: 100%;
    height: 36px;
}

@media (max-width: 800px) {
    .sfx-player-sidebar {
        top: auto;
        bottom: 1.5rem;
        right: 50%;
        transform: translateX(50%);
        width: 100%;
        max-width: 400px;
        min-width: min(100% - 2rem, 320px);
    }
    .active-sounds-container {
        width: 100%;
        padding-right: 0;
    }
}