/* AfroBeatStars BeatStars-inspired global player. Scoped to #afbs-global-player only. */
#afbs-global-player,
#afbs-global-player * { box-sizing: border-box; }
#afbs-global-player audio { display: none; }

#afbs-global-player {
    --afbs-player-accent: #8B5CF6;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: none;
    color: #f9fafb;
    background: #09090b;
    border-top: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 -10px 35px rgba(0,0,0,.28);
    font-family: inherit;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
#afbs-global-player.afbs-gp--visible { display: block; }

/* Waveform / seek row */
#afbs-global-player .afbs-gp__wave-row {
    max-width: 1600px;
    height: 43px;
    margin: 0 auto;
    padding: 5px 24px 2px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 42px;
    align-items: center;
    gap: 14px;
}
#afbs-global-player .afbs-gp__wave-time {
    color: #f4f4f5;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
#afbs-global-player .afbs-gp__wave-wrap {
    min-width: 0;
    height: 35px;
    position: relative;
    display: flex;
    align-items: center;
}
#afbs-global-player .afbs-gp__waveform {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    overflow: hidden;
    pointer-events: none;
}
#afbs-global-player .afbs-gp__waveform-bar {
    flex: 1 1 0;
    min-width: 1px;
    max-width: 4px;
    height: var(--bar-height, 45%);
    border-radius: 2px;
    background: #45454a;
    opacity: .92;
}
#afbs-global-player .afbs-gp__waveform-bar.is-played { background: var(--afbs-player-accent); opacity: 1; }
#afbs-global-player .afbs-gp__seek {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    outline: none;
}
#afbs-global-player .afbs-gp__seek::-webkit-slider-runnable-track { height: 100%; background: transparent; }
#afbs-global-player .afbs-gp__seek::-moz-range-track { height: 100%; background: transparent; }
#afbs-global-player .afbs-gp__seek::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 1px solid #111; opacity: 0;
}
#afbs-global-player .afbs-gp__seek::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 1px solid #111; opacity: 0;
}
#afbs-global-player .afbs-gp__wave-wrap:hover .afbs-gp__seek::-webkit-slider-thumb,
#afbs-global-player .afbs-gp__seek:focus::-webkit-slider-thumb,
#afbs-global-player .afbs-gp__wave-wrap:hover .afbs-gp__seek::-moz-range-thumb,
#afbs-global-player .afbs-gp__seek:focus::-moz-range-thumb { opacity: 1; }

/* Main player row */
#afbs-global-player .afbs-gp__inner {
    min-height: 66px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 4px 24px 10px;
    display: grid;
    grid-template-columns: minmax(260px, 1.15fr) minmax(220px, .9fr) minmax(250px, 1.1fr);
    align-items: center;
    gap: 20px;
}
#afbs-global-player .afbs-gp__track { min-width: 0; display: flex; align-items: center; gap: 12px; }
#afbs-global-player .afbs-gp__artwork {
    width: 48px; height: 48px; flex: 0 0 48px;
    object-fit: cover; border-radius: 5px; background: #292936;
}
#afbs-global-player .afbs-gp__metadata { min-width: 0; }
#afbs-global-player .afbs-gp__title {
    color: #fff; font-size: 13px; font-weight: 700; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#afbs-global-player .afbs-gp__producer {
    display: flex; align-items: center; gap: 4px; min-width: 0;
    color: #b4b4b8; font-size: 11px; margin-top: 3px; line-height: 1.2;
}
#afbs-global-player .afbs-gp__producer-name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#afbs-global-player .afbs-gp__verified-badge {
    flex: 0 0 auto; color: var(--afbs-player-accent); font-size: 11px; line-height: 1;
}
#afbs-global-player .afbs-gp__verified-badge[hidden] { display: none !important; }
#afbs-global-player .afbs-gp__stats {
    display: flex; align-items: center; gap: 6px; margin-top: 3px;
    color: #929299; font-size: 10px; line-height: 1.2; white-space: nowrap;
}
#afbs-global-player .afbs-gp__dot { color: #5d5d63; }
#afbs-global-player button { border: 0; cursor: pointer; font: inherit; outline-offset: 3px; }
#afbs-global-player button:disabled { opacity: .55; cursor: wait; }
#afbs-global-player .afbs-gp__transport { display: flex; align-items: center; justify-content: center; gap: 12px; }
#afbs-global-player .afbs-gp__icon-btn {
    min-width: 33px; width: 33px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    color: #e4e4e7; background: transparent; border-radius: 50%; font-size: 15px;
    transition: color .15s ease, background .15s ease, transform .15s ease;
}
#afbs-global-player .afbs-gp__icon-btn:hover { color: #fff; background: rgba(255,255,255,.10); }
#afbs-global-player .afbs-gp__like { width: auto; min-width: 36px; padding: 0 5px; }
#afbs-global-player .afbs-gp__like-count { font-size: 10px; font-weight: 700; color: #b8b8be; }
#afbs-global-player .afbs-gp__like.is-liked { color: #fb7185; }
#afbs-global-player .afbs-gp__like.is-liked .afbs-gp__like-count { color: #fda4af; }
#afbs-global-player .afbs-gp__play-btn {
    width: 38px; height: 38px; border-radius: 50%; color: #fff; background: transparent;
    display: inline-flex; align-items: center; justify-content: center; font-size: 21px;
    transition: transform .15s ease, color .15s ease;
}
#afbs-global-player .afbs-gp__play-btn:hover { transform: scale(1.08); color: #c4b5fd; }
#afbs-global-player .afbs-gp__extras { display: flex; align-items: center; justify-content: flex-end; gap: 13px; min-width: 0; }
#afbs-global-player .afbs-gp__action-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 5px;
    color: #e4e4e7; background: transparent; border-radius: 7px; font-size: 11px; white-space: nowrap;
}
#afbs-global-player .afbs-gp__action-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
#afbs-global-player .afbs-gp__action-btn.is-active { color: #c4b5fd; background: rgba(139,92,246,.15); }
#afbs-global-player .afbs-gp__volume-wrap { display: flex; align-items: center; gap: 8px; color: #e4e4e7; font-size: 14px; }
#afbs-global-player .afbs-gp__volume-wrap input { width: 72px; accent-color: var(--afbs-player-accent); cursor: pointer; }
#afbs-global-player .afbs-gp__purchase {
    min-height: 33px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 13px; border-radius: 7px; color: #fff; background: var(--afbs-player-accent);
    font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap;
    box-shadow: 0 3px 10px rgba(139,92,246,.24); transition: background .15s ease, transform .15s ease;
}
#afbs-global-player .afbs-gp__purchase:hover { color: #fff; background: #7C3AED; transform: translateY(-1px); }
#afbs-global-player .afbs-gp__purchase[aria-disabled="true"] { color: #b6b6be; background: #29292f; box-shadow: none; pointer-events: none; }
#afbs-global-player .afbs-gp__close:hover { color: #fca5a5; background: rgba(239,68,68,.12); }

/* Queue panel */
#afbs-global-player .afbs-gp__queue {
    position: absolute; right: 20px; bottom: calc(100% + 10px);
    width: min(370px, calc(100vw - 24px)); max-height: 360px; overflow: hidden;
    color: #f9fafb; background: #171821; border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px; box-shadow: 0 18px 55px rgba(0,0,0,.35);
}
#afbs-global-player .afbs-gp__queue[hidden] { display: none; }
#afbs-global-player .afbs-gp__queue-heading { display: flex; justify-content: space-between; align-items: center; padding: 14px 15px; border-bottom: 1px solid rgba(255,255,255,.10); font-size: 12px; }
#afbs-global-player .afbs-gp__queue-heading span { color: #a1a1aa; font-size: 10px; }
#afbs-global-player .afbs-gp__queue-items { overflow-y: auto; max-height: 300px; padding: 5px; }
#afbs-global-player .afbs-gp__queue-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; color: #e4e4e7; background: transparent; border-radius: 8px; text-align: left; }
#afbs-global-player .afbs-gp__queue-item:hover,
#afbs-global-player .afbs-gp__queue-item.is-current { background: rgba(139,92,246,.18); }
#afbs-global-player .afbs-gp__queue-item img { width: 38px; height: 38px; flex: 0 0 38px; object-fit: cover; border-radius: 5px; }
#afbs-global-player .afbs-gp__queue-item span { min-width: 0; display: block; }
#afbs-global-player .afbs-gp__queue-item strong,
#afbs-global-player .afbs-gp__queue-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#afbs-global-player .afbs-gp__queue-item strong { font-size: 11px; }
#afbs-global-player .afbs-gp__queue-item small { color: #a1a1aa; font-size: 10px; margin-top: 3px; }

/* Retire the old page-specific mini-player visuals only after this player initializes. */
body.afbs-global-player-ready #playerWrapper { display: none !important; }
body.afbs-global-player-active { padding-bottom: 132px !important; }
body.afbs-global-player-active.afbs-global-player-no-mobile-nav { padding-bottom: 132px !important; }
body.afbs-global-player-active #pwa-install-container { bottom: 130px !important; }
body.afbs-global-player-active #messengerBox { bottom: 130px !important; }

@media (max-width: 980px) {
    #afbs-global-player .afbs-gp__inner { grid-template-columns: minmax(210px, 1fr) auto minmax(190px, 1fr); gap: 10px; padding-left: 14px; padding-right: 14px; }
    #afbs-global-player .afbs-gp__transport { gap: 6px; }
    #afbs-global-player .afbs-gp__extras { gap: 7px; }
    #afbs-global-player .afbs-gp__volume-wrap input { width: 55px; }
}

@media (max-width: 767px) {
    #afbs-global-player { bottom: 64px; }
    #afbs-global-player.afbs-gp--above-ad { bottom: 144px; }
    #afbs-global-player.afbs-gp--no-mobile-nav { bottom: 0; }
    #afbs-global-player .afbs-gp__wave-row { height: 31px; grid-template-columns: 34px minmax(0,1fr) 34px; gap: 6px; padding: 3px 10px 0; }
    #afbs-global-player .afbs-gp__wave-wrap { height: 26px; }
    #afbs-global-player .afbs-gp__wave-time { font-size: 9px; }
    #afbs-global-player .afbs-gp__inner {
        min-height: 94px; padding: 5px 10px 8px;
        grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 5px 7px;
    }
    #afbs-global-player .afbs-gp__track { grid-column: 1; grid-row: 1; gap: 8px; }
    #afbs-global-player .afbs-gp__artwork { width: 39px; height: 39px; flex-basis: 39px; }
    #afbs-global-player .afbs-gp__title { font-size: 10px; }
    #afbs-global-player .afbs-gp__producer { font-size: 9px; margin-top: 2px; }
    #afbs-global-player .afbs-gp__stats { font-size: 8px; margin-top: 2px; gap: 4px; }
    #afbs-global-player .afbs-gp__transport { grid-column: 2; grid-row: 1; gap: 1px; }
    #afbs-global-player .afbs-gp__icon-btn { min-width: 26px; width: 26px; height: 29px; font-size: 12px; }
    #afbs-global-player .afbs-gp__like { min-width: 30px; width: 30px; padding: 0 1px; }
    #afbs-global-player .afbs-gp__like-count { font-size: 8px; }
    #afbs-global-player .afbs-gp__play-btn { width: 32px; height: 32px; font-size: 17px; }
    #afbs-global-player .afbs-gp__extras { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 6px; }
    #afbs-global-player .afbs-gp__action-btn { padding: 5px 3px; font-size: 9px; }
    #afbs-global-player .afbs-gp__volume-wrap { font-size: 12px; }
    #afbs-global-player .afbs-gp__volume-wrap input { display: none; }
    #afbs-global-player .afbs-gp__purchase { min-height: 29px; padding: 0 10px; font-size: 9px; }
    #afbs-global-player .afbs-gp__close { min-width: 24px; width: 24px; }
    #afbs-global-player .afbs-gp__queue { right: 8px; bottom: calc(100% + 8px); }
    body.afbs-global-player-active { padding-bottom: 230px !important; }
    body.afbs-global-player-active.afbs-global-player-ad-gap { padding-bottom: 298px !important; }
    body.afbs-global-player-active.afbs-global-player-no-mobile-nav { padding-bottom: 166px !important; }
    body.afbs-global-player-active #pwa-install-container { bottom: 224px !important; }
    body.afbs-global-player-active #messengerBox { bottom: 224px !important; }
}

@media (max-width: 380px) {
    #afbs-global-player .afbs-gp__transport { gap: 0; }
    #afbs-global-player .afbs-gp__icon-btn { min-width: 23px; width: 23px; }
    #afbs-global-player .afbs-gp__like { min-width: 27px; width: 27px; }
    #afbs-global-player .afbs-gp__purchase { padding: 0 7px; }
}
