
/* ===========================
   GLOBAL PLAYER POSITION
   =========================== */
#global-player {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 99999;
    width: min(980px, calc(100% - 24px));
    pointer-events: none;
}

.gp-shell {
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(123, 91, 230, 0.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(79, 70, 229, 0.12), transparent 26%),
        rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 18px 40px rgba(2, 6, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ===========================
   MINIMIZED STATE
   =========================== */
#global-player.gp-minimized .gp-shell {
    grid-template-columns: auto auto 1fr auto;
    padding: 10px 12px;
    border-radius: 18px;
}

#global-player.gp-minimized .gp-main {
    display: none;
}

#global-player.gp-minimized .gp-volume-range,
#global-player.gp-minimized #gp-volume-btn,
#global-player.gp-minimized #gp-repeat {
    display: none !important;
}

#global-player.gp-minimized {
    width: min(420px, calc(100% - 16px));
}

/* ===========================
   COVER
   =========================== */
.gp-cover-wrap {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.gp-cover {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

/* ===========================
   BUTTONS
   =========================== */
.gp-btn {
    position: relative;
    z-index: 3;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 17px;
    cursor: pointer;
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
    flex-shrink: 0;
}

.gp-btn:hover {
    transform: translateY(-1px) scale(1.04);
    background: rgba(255, 255, 255, 0.14);
}

.gp-btn:active {
    transform: scale(0.96);
}

.gp-btn-primary {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.gp-btn-primary:hover {
    background: linear-gradient(135deg, #9466ff, #6d72ff);
}

.gp-btn.repeat-active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

/* ===========================
   MAIN INFO
   =========================== */
.gp-main {
    position: relative;
    z-index: 3;
    min-width: 0;
}

.gp-title {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gp-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 7px;
    font-size: 0.77rem;
    color: rgba(226, 232, 240, 0.72);
}

#gp-current,
#gp-duration {
    min-width: 40px;
    text-align: center;
}

/* ===========================
   RANGE - PROGRESS
   =========================== */
.gp-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    outline: none;
    cursor: pointer;
}

.gp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.gp-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: #8b5cf6;
}

/* ===========================
   ACTIONS
   =========================== */
.gp-actions {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ===========================
   VOLUME
   =========================== */
.gp-volume-range {
    -webkit-appearance: none;
    appearance: none;
    width: 92px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
}

.gp-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8b5cf6;
}

.gp-volume-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: #8b5cf6;
}

/* ===========================
   WAVES
   =========================== */
.gp-waves {
    position: absolute;
    inset: auto 0 0 0;

    width: 100%;
    height: 32px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 2px;
    padding: 0 8px 6px;

    opacity: .25;
    pointer-events: none;
    z-index: 1;
}

.gp-waves span {

    flex: 1;
    min-width: 2px;

    height: 6px;
    border-radius: 2px;

    background: linear-gradient(180deg,#a78bfa,#6366f1);

    transform-origin: bottom;

    transition: height .05s linear, opacity .05s linear;
}

.gp-waves span:nth-child(2n) { animation-duration: 1.35s; }
.gp-waves span:nth-child(3n) { animation-duration: 0.95s; }
.gp-waves span:nth-child(4n) { animation-duration: 1.5s; }

@keyframes gpWave {
    0%   { height: 6px; opacity: 0.45; }
    50%  { height: 26px; opacity: 0.9; }
    100% { height: 6px; opacity: 0.45; }
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    #global-player {
        width: calc(100% - 16px);
        bottom: 8px;
    }

    .gp-shell {
        grid-template-columns: auto auto 1fr auto;
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
    }

    .gp-cover {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .gp-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .gp-btn-primary {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .gp-title {
        font-size: 0.88rem;
    }

    .gp-times {
        font-size: 0.72rem;
    }

    .gp-volume-range {
        width: 70px;
    }
}

@media (max-width: 640px) {
    #global-player {
        width: calc(100% - 12px);
        bottom: 6px;
    }

    .gp-shell {
        grid-template-columns: auto auto 1fr auto;
        gap: 10px;
        padding: 10px;
        border-radius: 16px;
    }

    .gp-cover {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .gp-title {
        font-size: 0.82rem;
        margin-bottom: 7px;
    }

    .gp-range {
        height: 5px;
    }

    .gp-times {
        font-size: 0.68rem;
        margin-top: 6px;
    }

    #gp-volume-btn,
    #gp-volume {
        display: none !important;
    }

    .gp-actions {
        gap: 8px;
    }

    .gp-waves {
        height: 24px;
        padding: 0 10px 6px;
        opacity: 0.16;
    }

    #global-player.gp-minimized {
        width: calc(100% - 12px);
    }
}