:root {
    --sc-bg: #0f172a;
    --sc-surface: rgba(255, 255, 255, 0.08);
    --sc-accent: #22c55e;
    --sc-accent-soft: #2dd4bf;
    --sc-text: #f8fafc;
    --sc-muted: rgba(203, 213, 225, 0.72);
}

.global-audio-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background:
        radial-gradient(
            circle at 10% 20%,
            rgba(34, 197, 94, 0.24),
            transparent 40%
        ),
        radial-gradient(
            circle at 88% 18%,
            rgba(45, 212, 191, 0.14),
            transparent 34%
        ),
        linear-gradient(90deg, #111827, var(--sc-bg));
    color: var(--sc-text);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(8px);
}

.player-head {
    display: grid;
    grid-template-columns:
        40px minmax(120px, 0.9fr) auto minmax(200px, 1.1fr)
        auto;
    gap: 0.45rem;
    align-items: center;
}

.player-meta {
    min-width: 0;
}

.player-cover {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(145deg, #22c55e, #2dd4bf);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #052e2b;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.player-cover i {
    font-size: 1.2rem;
    transform-origin: center;
}

.player-cover.playing i {
    animation:
        cover-spin 2.2s linear infinite,
        cover-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes cover-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes cover-pulse {
    from {
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }

    to {
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
    }
}

.player-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

.player-hint {
    color: var(--sc-muted);
    font-size: 0.66rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.player-btn {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.player-btn-main {
    background: var(--sc-accent);
    border-color: var(--sc-accent);
    color: #052e2b;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.28);
}

.player-btn-main:hover {
    background: var(--sc-accent-soft);
    border-color: var(--sc-accent-soft);
    color: #052e2b;
}

.player-wave-wrap {
    margin-top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
}

.player-time {
    font-size: 0.62rem;
    color: var(--sc-muted);
    min-width: 34px;
    text-align: center;
}

.waveform {
    position: relative;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    direction: ltr;
    unicode-bidi: isolate;
    cursor: pointer;
}

.file-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, var(--sc-accent), #22d3ee);
    transition: width 0.15s linear;
    pointer-events: none;
    z-index: 1;
}

.seek-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.001;
    cursor: ew-resize;
    width: 100%;
    direction: ltr;
    unicode-bidi: isolate;
    touch-action: none;
    z-index: 2;
    pointer-events: auto;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin: 0;
}

.seek-overlay:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.75);
}

.seek-overlay::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 1px;
    border: 0;
    background: transparent;
}

.seek-overlay::-moz-range-thumb {
    width: 1px;
    height: 1px;
    border: 0;
    background: transparent;
}

.global-player-inner {
    position: relative;
}

.volume-wrap {
    align-items: center;
    gap: 0.3rem;
    color: var(--sc-muted);
    font-size: 0.64rem;
}

.volume-input {
    width: 64px;
    accent-color: var(--sc-accent);
}

.player-head > .volume-wrap {
    margin-inline-start: 0.2rem;
}

.player-queue-panel {
    position: absolute;
    inset-inline-end: 0.5rem;
    bottom: calc(100% + 10px);
    width: min(420px, calc(100vw - 1rem));
    background: rgba(30, 41, 59, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    max-height: 280px;
    overflow: hidden;
    padding: 0.45rem;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(10px);
}

.player-queue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.player-queue-head .player-btn {
    min-width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

#global-queue-items {
    max-height: 200px;
    overflow-y: auto;
    padding-inline-end: 0.15rem;
}

.player-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 9px;
    padding: 0.36rem 0.52rem;
    color: #fff;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: right;
}

.player-queue-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.player-queue-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    font-size: 0.66rem;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.player-queue-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-queue-action-btn.danger {
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.repeat-active {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.65) !important;
    color: #bbf7d0 !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25) inset;
}

.queue-open {
    background: rgba(255, 255, 255, 0.13) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

.player-queue-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.13);
}

.player-queue-item.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
}

.player-queue-index {
    font-size: 0.72rem;
    color: var(--sc-muted);
    min-width: 30px;
}

.player-queue-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

@media (max-width: 768px) {
    .global-audio-player {
        bottom: 38px;
        right: 45px;
        left: 10px;
        border-radius: 1.5rem;
    }
    .floating-audio-btn {
        background: linear-gradient(145deg, #22c55e, #2dd4bf);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #052e2b;
        font-weight: 700;
        font-size: 0.8rem;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    }
    .floating-audio-btn i {
        animation:
            cover-spin 2.2s linear infinite,
            cover-pulse 1.1s ease-in-out infinite alternate;
    }
    .global-player-inner {
        padding: 0.45rem 1.3rem;
    }

    .player-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem;
        align-items: center;
    }

    .player-queue-panel {
        inset-inline: 0.5rem;
        width: auto;
        max-height: 240px;
    }

    .player-meta {
        grid-column: 1 / 2;
    }

    .player-title {
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .player-hint {
        display: none;
    }

    .player-head > .volume-wrap {
        display: none;
    }

    .player-cover {
        display: none !important;
    }

    .player-cover i {
        display: none;
    }

    .player-controls {
        grid-column: 2 / 3;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0.2rem;
        min-width: max-content;
    }

    .player-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.86rem;
    }

    .player-btn-main {
        min-width: 34px;
        height: 34px;
    }

    #global-repeat-one,
    #global-repeat-all {
        display: none !important;
    }

    .player-wave-wrap {
        display: none;
    }

    .player-time {
        display: none;
    }

    .waveform {
        display: none;
    }
}

.js-listening-toggle.is-in-queue {
    background-color: #ecfdf5;
    border-color: #22c55e;
    color: #047857;
}

.js-listening-toggle.is-in-queue i {
    color: #22c55e;
}
