:root {
    --sc-bg: #111827;
    --sc-surface: #1f2937;
    --sc-accent: #ff5500;
    --sc-accent-soft: #ff7a33;
    --sc-text: #f9fafb;
    --sc-muted: rgba(249, 250, 251, 0.72);
}

body {
    padding-bottom: 145px;
}

.global-audio-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background:
        radial-gradient(
            circle at 10% 20%,
            rgba(255, 85, 0, 0.28),
            transparent 38%
        ),
        linear-gradient(90deg, var(--sc-bg), #0f172a);
    color: var(--sc-text);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -14px 30px rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(6px);
}

.player-head {
    display: grid;
    grid-template-columns:
        44px minmax(140px, 0.85fr) auto minmax(220px, 1.15fr)
        auto;
    gap: 0.55rem;
    align-items: center;
}

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

.player-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(145deg, #ff5500, #ff8b4d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2b1100;
    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.35rem;
    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.85rem;
}

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

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

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

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

.player-btn-main {
    background: var(--sc-accent);
    border-color: var(--sc-accent);
    color: #2b1100;
    box-shadow: 0 6px 18px rgba(255, 85, 0, 0.35);
}

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

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

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

.waveform {
    position: relative;
    height: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    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), var(--sc-accent-soft));
    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(255, 122, 51, 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.4rem;
    color: var(--sc-muted);
    font-size: 0.68rem;
}

.volume-input {
    width: 72px;
    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(15, 23, 42, 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(255, 85, 0, 0.22) !important;
    border-color: rgba(255, 122, 51, 0.65) !important;
    color: #ffd9c2 !important;
    box-shadow: 0 0 0 1px rgba(255, 85, 0, 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(255, 85, 0, 0.22);
    border-color: rgba(255, 122, 51, 0.65);
}

.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) {
    .player-head {
        grid-template-columns: 44px minmax(0, 1fr);
    }

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

    .player-head > .volume-wrap {
        grid-column: 1 / -1;
        margin-inline-start: 0;
        justify-content: flex-start;
    }

    .player-cover {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
    }

    .player-cover i {
        font-size: 1.15rem;
    }

    .player-controls {
        grid-column: 1 / -1;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .player-btn {
        min-width: 64px;
        font-size: 0.72rem;
    }
}

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

.js-listening-toggle.is-in-queue i {
    color: #10b981;
}
