/* ==========================================================================
   Radio Mini-Player — flottant sous le burger menu
   ========================================================================== */
/* Largeur incluant marges intérieures et bordure : sans cela, tout élément
   en width:100% avec du padding déborde par la droite. */
.acc-radio-mini, .acc-radio-mini * {
    box-sizing: border-box;
}


/* Le lecteur reste pleinement visible, en toutes circonstances.
   Il était posé à 0.2 et ne se révélait qu'au survol : sur une tablette il
   n'y a pas de survol, il restait donc invisible. Plutôt que de traiter le
   tactile à part, on assume qu'un lecteur de radio a le droit de se voir.
   (30/08/2026) */
.acc-radio-mini {
    position: fixed;
    top: 50px;
    right: 15px;
    z-index: 9999;
    opacity: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* ---------- Player bar ---------- */
.acc-radio-player {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 51, 51, 0.2);
    border-radius: 25px;
    padding: 5px 12px;
    white-space: nowrap;
}

/* Buttons */
.acc-radio-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.acc-radio-btn:hover {
    color: #ff3333;
}

.acc-radio-btn--play {
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(255, 51, 51, 0.5);
    background: rgba(255, 51, 51, 0.1);
}

.acc-radio-btn--play:hover {
    border-color: #ff3333;
    background: rgba(255, 51, 51, 0.2);
}

.acc-radio-btn--shuffle.is-active {
    color: #ff3333;
}

.acc-radio-btn--small {
    width: 24px;
    height: 24px;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.acc-radio-btn--danger:hover {
    color: #ff3333;
    border-color: #ff3333;
}

/* Info + progress inline */
/* Soutenir le morceau en cours : renvoie vers sa page Bandcamp.
   Discret au repos, rouge au survol - c'est une proposition, pas une sollicitation. */
.acc-radio-buy {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #888888;
    transition: color 0.2s ease, transform 0.2s ease;
}

.acc-radio-buy:hover {
    color: #ff3333;
    transform: scale(1.15);
}

/* ---------- Pochette du morceau en cours ---------- */
/* Carrée et non recadrée : c'est une pochette, pas une vignette. */
.acc-radio-cover {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 3px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 51, 51, 0.25);
    display: block;
}

.acc-radio-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acc-radio-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2a1010);
}

.acc-radio-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    max-width: 160px;
}

.acc-radio-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acc-radio-progress {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.acc-radio-progress-fill {
    height: 100%;
    background: #ff3333;
    border-radius: 2px;
    width: 0;
    transition: width 0.1s linear;
}

/* Volume mini */
.acc-radio-volume {
    display: flex;
    align-items: center;
}

.acc-radio-volume input[type="range"] {
    width: 50px;
    accent-color: #ff3333;
    height: 3px;
}

/* ---------- Tracklist toggle (2 lines) ---------- */
.acc-radio-tracklist-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 28px;
    height: 20px;
    margin-top: 6px;
    margin-right: 8px;
    align-self: flex-end;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.acc-radio-tracklist-toggle:hover {
    opacity: 1;
}

.acc-radio-tracklist-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #ff3333;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Toggle open state: X */
.acc-radio-tracklist-toggle.is-open span:first-child {
    transform: rotate(25deg) translateY(3px);
}

.acc-radio-tracklist-toggle.is-open span:last-child {
    transform: rotate(-25deg) translateY(-3px);
}

/* ---------- Tracklist panel ---------- */
.acc-radio-tracklist-panel {
    display: none;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 51, 51, 0.15);
    border-radius: 8px;
    padding: 10px;
    margin-top: 6px;
    width: 320px;
    max-height: 60vh;
    overflow: hidden;
}

.acc-radio-tracklist-panel.is-open {
    display: block;
}

/* Playlist header */
.acc-radio-playlist-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.acc-radio-select {
    flex: 1;
    background: #0d0000;
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.8rem;
}

.acc-radio-select:focus {
    outline: none;
    border-color: #ff3333;
}

/* Tracklist items */
.acc-radio-tracklist {
    max-height: calc(60vh - 50px);
    overflow-y: auto;
}

.acc-radio-track {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 3px;
}

.acc-radio-track:hover {
    background: rgba(255, 51, 51, 0.08);
}

.acc-radio-track.is-playing {
    background: rgba(255, 51, 51, 0.12);
}

.acc-radio-track.is-playing .acc-radio-track-title {
    color: #ff3333;
}

.acc-radio-track-title {
    flex: 1;
    font-size: 0.8rem;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acc-radio-track-source {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    flex-shrink: 0;
}

.acc-radio-track-toggle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: none;
    color: #888;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.acc-radio-track-toggle:hover {
    border-color: #ff3333;
    color: #ff3333;
}

.acc-radio-track-toggle.is-in-playlist {
    background: rgba(255, 51, 51, 0.2);
    border-color: #ff3333;
    color: #ff3333;
}

/* Scrollbar */
.acc-radio-tracklist::-webkit-scrollbar {
    width: 4px;
}

.acc-radio-tracklist::-webkit-scrollbar-track {
    background: transparent;
}

.acc-radio-tracklist::-webkit-scrollbar-thumb {
    background: rgba(255, 51, 51, 0.3);
    border-radius: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .acc-radio-mini {
        top: 10px;
        right: 10px;
    }

    .acc-radio-info {
        max-width: 100px;
    }

    .acc-radio-volume {
        display: none;
    }

    .acc-radio-tracklist-panel {
        width: calc(100vw - 30px);
    }
}

/* ==========================================================================
   Appareils tactiles

   Acc travaille sur iPad, en paysage, c'est son appareil principal - et une
   bonne part des visiteurs sont dans le même cas. Or le lecteur était pensé
   pour la souris : posé à 20 % d'opacité, il ne devenait lisible qu'au survol.
   Sans souris, il n'y a pas de survol : le lecteur restait donc quasi
   invisible tant qu'on n'avait pas deviné qu'il fallait le toucher.

   On garde l'intention - un lecteur discret, qui ne s'impose pas - mais à une
   opacité qui se voit. Et les cibles passent à 44 px, la taille au doigt
   recommandée par Apple : les boutons faisaient 24 px, le dépliant 28 par 20.
   ========================================================================== */

@media (hover: none) {
    .acc-radio-player {
        gap: 2px;
        padding: 6px 10px;
    }

    .acc-radio-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        justify-content: center;
    }

    .acc-radio-btn--small {
        min-width: 36px;
        min-height: 36px;
    }

    .acc-radio-tracklist-toggle {
        width: 44px;
        height: 44px;
        margin-top: 2px;
    }

    /* La barre de progression se pointe au doigt : elle doit être attrapable. */
    .acc-radio-progress {
        height: 10px;
        padding: 4px 0;
        background-clip: content-box;
    }

    .acc-radio-track {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}
