.gcap-player,
.gcap-player *,
.gcap-player *::before,
.gcap-player *::after {
    box-sizing: border-box;
}

.gcap-player {
    --gcap-fuchsia: #e6007e;
    --gcap-fuchsia-dark: #b2005f;
    --gcap-gold: #d4af37;
    --gcap-scale-current: var(--gcap-scale-desktop, 1);
    --gcap-pad-current: var(--gcap-pad-desktop, 16px);

    position: fixed;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 7px;
    padding-bottom: 7px;
    padding-left: var(--gcap-pad-current);
    padding-right: var(--gcap-pad-current);
    background: linear-gradient(135deg, var(--gcap-fuchsia), var(--gcap-fuchsia-dark));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(230, 0, 126, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #fff;
    max-width: 320px;
    line-height: 1;
    /* Échelle réglée depuis l'admin : desktop par défaut, écrasée en dessous de 600px */
    transform: scale(var(--gcap-scale-current));
    transition: box-shadow 0.2s ease;
}

.gcap-player[data-position="bottom-right"] { transform-origin: bottom right; }
.gcap-player[data-position="bottom-left"]  { transform-origin: bottom left; }

.gcap-player:not(.gcap-preview) {
    animation: gcap-float-in 0.5s ease-out;
}

.gcap-player.gcap-shake:not(.gcap-preview) {
    animation: gcap-float-in 0.5s ease-out, gcap-attention 10s ease-in-out 1s infinite;
}

@keyframes gcap-float-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Wobble discret toutes les 10 secondes, façon lebonheurestdanslapoele.com :
   un léger balancement qui s'amortit, pas une secousse franche. */
@keyframes gcap-attention {
    0%, 95%, 100% { transform: scale(var(--gcap-scale-current)) rotate(0deg) translateX(0); }
    96%   { transform: scale(var(--gcap-scale-current)) rotate(-2deg) translateX(-2px); }
    96.5% { transform: scale(var(--gcap-scale-current)) rotate(2deg) translateX(2px); }
    97%   { transform: scale(var(--gcap-scale-current)) rotate(-1.4deg) translateX(-1px); }
    97.5% { transform: scale(var(--gcap-scale-current)) rotate(1.4deg) translateX(1px); }
    98%   { transform: scale(var(--gcap-scale-current)) rotate(-0.6deg); }
    98.5% { transform: scale(var(--gcap-scale-current)) rotate(0.6deg); }
}


.gcap-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin: auto 0;
}

.gcap-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: auto 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.gcap-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.06);
}

.gcap-toggle:active {
    transform: scale(0.95);
}

/* Icône lecture : triangle pur CSS, décalé de 1px pour compenser
   l'illusion optique du triangle (son "centre visuel" n'est pas
   son centre géométrique) — donc vraiment centré à l'œil. */
.gcap-toggle .gcap-icon-play,
.gcap-toggle .gcap-icon-pause {
    display: block;
}

.gcap-toggle .gcap-icon-play {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #fff;
    margin-left: 3px;
}

.gcap-toggle .gcap-icon-pause {
    display: none;
    width: 9px;
    height: 11px;
    position: relative;
}

.gcap-toggle .gcap-icon-pause::before,
.gcap-toggle .gcap-icon-pause::after {
    content: "";
    position: absolute;
    top: 0;
    width: 3px;
    height: 11px;
    background: #fff;
    border-radius: 1px;
}

.gcap-toggle .gcap-icon-pause::before { left: 0; }
.gcap-toggle .gcap-icon-pause::after  { right: 0; }

.gcap-player.is-playing .gcap-toggle .gcap-icon-play  { display: none; }
.gcap-player.is-playing .gcap-toggle .gcap-icon-pause { display: block; }

/* Petit égaliseur animé — visible quand la musique joue */
.gcap-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    margin: auto 0;
    flex-shrink: 0;
}

.gcap-eq i {
    display: block;
    width: 3px;
    background: var(--gcap-gold);
    border-radius: 2px;
    height: 4px;
    opacity: 0.5;
}

.gcap-player.is-playing .gcap-eq i {
    opacity: 1;
    animation: gcap-eq-bounce 0.9s ease-in-out infinite;
}

.gcap-player.is-playing .gcap-eq i:nth-child(1) { animation-delay: 0s; }
.gcap-player.is-playing .gcap-eq i:nth-child(2) { animation-delay: 0.15s; }
.gcap-player.is-playing .gcap-eq i:nth-child(3) { animation-delay: 0.3s; }
.gcap-player.is-playing .gcap-eq i:nth-child(4) { animation-delay: 0.45s; }

@keyframes gcap-eq-bounce {
    0%, 100% { height: 4px; }
    50%      { height: 16px; }
}

@media (max-width: 600px) {
    .gcap-player:not(.gcap-preview) {
        --gcap-scale-current: var(--gcap-scale-mobile, 0.7);
        --gcap-pad-current: var(--gcap-pad-mobile, 12px);
    }
    .gcap-label { max-width: 130px; }
}
