/* =====================================================================
   Romanche Basket — Lecteur Musique
   Style "Premium" cohérent avec l'app Adhésion (couleurs du club)
   Palette : bleu club primaire, base blanc/gris clair, orange en accent
   ===================================================================== */

:root{
    --club:#269AD3;      /* bleu club primaire        */
    --club-d:#1C7FB0;    /* bleu club foncé           */
    --club-dk:#0F5F87;   /* bleu club très foncé      */
    --accent:#FF8C00;    /* orange accent             */
    --accent-d:#E67E00;  /* orange accent foncé       */
    --ink:#14110F;       /* encre (quasi-noir)        */
    --bg:#f5f8fb;        /* fond de page              */
    --muted:#8a8a93;     /* texte secondaire          */
    --line:#e3e9ee;      /* lignes / séparateurs      */
    --radius:20px;
    --shadow:0 18px 50px rgba(15,95,135,.10);
    --shadow-sm:0 8px 26px rgba(15,95,135,.08);
}

*{ font-family:'Montserrat',system-ui,-apple-system,Segoe UI,Roboto,sans-serif; box-sizing:border-box; }
html,body{ margin:0; }
body{ background:var(--bg); color:var(--ink); min-height:100vh; }
a{ text-decoration:none; }

/* ------------------------------------------------------------------ */
/* Logo encadré : carré arrondi, fond blanc, fin cadre noir + ombre    */
/* ------------------------------------------------------------------ */
.logo-badge{ background:#fff; border:1.5px solid var(--ink); border-radius:14px;
    padding:5px 9px; box-shadow:0 4px 14px rgba(0,0,0,.14); display:inline-flex; align-items:center; }
.logo-badge img{ height:34px; width:auto; display:block; }

/* ------------------------------------------------------------------ */
/* Barre de navigation (claire, sticky)                                */
/* ------------------------------------------------------------------ */
.rb-nav{ background:#fff; box-shadow:0 2px 14px rgba(15,95,135,.10);
    position:sticky; top:0; z-index:50; }
.rb-nav .inner{ max-width:1180px; margin:0 auto; padding:.7rem 1.1rem;
    display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.rb-nav .brand{ display:flex; align-items:center; gap:.7rem; }
.rb-nav .brand-txt{ font-weight:800; letter-spacing:-.5px; color:var(--ink); font-size:1.05rem; }
.rb-nav .brand-txt small{ display:block; font-weight:600; color:var(--club-dk);
    font-size:.72rem; letter-spacing:.3px; }
.rb-nav .nav-meta{ color:var(--muted); font-weight:600; font-size:.82rem;
    display:flex; align-items:center; gap:.4rem; }
.rb-nav .nav-meta .dot{ width:8px; height:8px; border-radius:50%; background:var(--accent);
    box-shadow:0 0 0 4px rgba(255,140,0,.18); }

/* ------------------------------------------------------------------ */
/* Mise en page générale                                               */
/* ------------------------------------------------------------------ */
.wrap{ max-width:1180px; margin:0 auto; padding:1.6rem 1.1rem 3rem; }
.hero{ margin-bottom:1.4rem; }
.hero h1{ font-weight:800; letter-spacing:-.6px; margin:0; font-size:1.7rem; }
.hero h1 .hl{ color:var(--club-dk); }
.hero p{ color:#2a2622; margin:.35rem 0 0; max-width:640px; }
.badge-pill{ display:inline-flex; align-items:center; gap:.45rem; background:rgba(38,154,211,.14);
    border:1px solid rgba(38,154,211,.4); color:var(--club-dk); font-weight:700;
    font-size:.78rem; padding:.3rem .8rem; border-radius:999px; margin-bottom:.7rem; }

.grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:1.4rem; align-items:start; }
@media (max-width:900px){ .grid{ grid-template-columns:1fr; } }

.card{ background:#fff; border:none; border-radius:var(--radius); box-shadow:var(--shadow); }

/* ------------------------------------------------------------------ */
/* Carte "Lecteur" (Now Playing)                                       */
/* ------------------------------------------------------------------ */
.player{ padding:1.5rem; position:sticky; top:84px; }
@media (max-width:900px){ .player{ position:static; } }

.cover{ position:relative; width:100%; aspect-ratio:1/1; border-radius:18px; overflow:hidden;
    background:linear-gradient(135deg,var(--club) 0%, var(--club-dk) 70%, var(--ink) 130%);
    display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);
    margin-bottom:1.2rem; }
.cover .note{ font-size:5rem; color:rgba(255,255,255,.88); filter:drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.cover .ring{ position:absolute; inset:0; border:2px solid rgba(255,255,255,.12); border-radius:18px;
    margin:14px; pointer-events:none; }
.cover .badge-cover{ position:absolute; left:14px; top:14px; background:rgba(255,255,255,.92);
    border-radius:10px; padding:3px 7px; display:inline-flex; align-items:center; }
.cover .badge-cover img{ height:24px; }

/* Égaliseur animé (visible quand la lecture est en cours) */
.eq{ position:absolute; bottom:18px; right:18px; display:flex; align-items:flex-end; gap:4px; height:34px; opacity:0; transition:.3s; }
.player.is-playing .eq{ opacity:1; }
.eq span{ width:5px; background:var(--accent); border-radius:3px; height:30%;
    animation:eq 1s ease-in-out infinite; }
.eq span:nth-child(2){ animation-delay:.2s; }
.eq span:nth-child(3){ animation-delay:.4s; }
.eq span:nth-child(4){ animation-delay:.1s; }
.eq span:nth-child(5){ animation-delay:.3s; }
@keyframes eq{ 0%,100%{ height:25%; } 50%{ height:95%; } }

.np-title{ font-weight:800; font-size:1.2rem; line-height:1.25; margin:0;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.np-sub{ color:var(--muted); font-weight:600; font-size:.85rem; margin:.2rem 0 0;
    display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.np-plays{ display:inline-flex; align-items:center; gap:.3rem; color:var(--accent-d);
    background:rgba(255,140,0,.12); border-radius:999px; padding:.1rem .55rem;
    font-weight:800; font-size:.78rem; }

/* Barre de progression */
.progress-row{ display:flex; align-items:center; gap:.6rem; margin-top:1.1rem; }
.time{ font-variant-numeric:tabular-nums; font-size:.78rem; font-weight:700; color:var(--muted); min-width:40px; text-align:center; }
input[type=range].seek, input[type=range].vol{
    -webkit-appearance:none; appearance:none; height:6px; border-radius:999px; background:var(--line);
    outline:none; cursor:pointer; flex:1; }
input[type=range].seek{ background:linear-gradient(var(--club),var(--club)) no-repeat var(--line);
    background-size:var(--fill,0%) 100%; }
input[type=range].vol{ background:linear-gradient(var(--club-dk),var(--club-dk)) no-repeat var(--line);
    background-size:var(--vfill,70%) 100%; max-width:120px; flex:none; }
input[type=range].seek::-webkit-slider-thumb, input[type=range].vol::-webkit-slider-thumb{
    -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:#fff;
    border:3px solid var(--club); box-shadow:0 2px 6px rgba(0,0,0,.2); transition:.15s; }
.seek::-webkit-slider-thumb:hover{ background:var(--accent); border-color:var(--accent); transform:scale(1.15); }
input[type=range].seek::-moz-range-thumb, input[type=range].vol::-moz-range-thumb{
    width:14px; height:14px; border-radius:50%; background:#fff; border:3px solid var(--club); }

/* Contrôles de lecture */
.controls{ display:flex; align-items:center; justify-content:center; gap:1.1rem; margin-top:1.1rem; }
.ctrl{ background:none; border:none; color:var(--ink); font-size:1.4rem; cursor:pointer;
    width:46px; height:46px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
    transition:.2s; }
.ctrl:hover{ color:var(--club-dk); background:rgba(38,154,211,.10); }
.ctrl.toggle{ color:var(--muted); font-size:1.15rem; }
.ctrl.toggle.on{ color:var(--accent); background:rgba(255,140,0,.12); }
.ctrl-play{ background:var(--club); border:none; color:#fff; width:66px; height:66px; border-radius:50%;
    font-size:1.7rem; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
    transition:.25s; box-shadow:0 10px 24px rgba(38,154,211,.4); }
.ctrl-play:hover{ background:var(--accent); transform:translateY(-2px) scale(1.04);
    box-shadow:0 14px 28px rgba(255,140,0,.4); }

.volume-row{ display:flex; align-items:center; gap:.6rem; margin-top:1.2rem; justify-content:center;
    color:var(--muted); }
.volume-row .bi{ font-size:1.1rem; cursor:pointer; }

/* ------------------------------------------------------------------ */
/* Carte "Playlist"                                                    */
/* ------------------------------------------------------------------ */
.playlist{ padding:1.3rem 1.3rem 1rem; }
.playlist .pl-head{ display:flex; align-items:center; justify-content:space-between; gap:.8rem;
    margin-bottom:.9rem; flex-wrap:wrap; }
.playlist .pl-title{ font-weight:800; color:var(--club-dk); font-size:1.1rem; margin:0;
    display:flex; align-items:center; gap:.5rem; }
.count{ background:var(--club); color:#fff; font-weight:800; font-size:.72rem; border-radius:999px;
    padding:.15rem .6rem; }
.search{ position:relative; flex:1; min-width:180px; max-width:280px; }
.search .bi{ position:absolute; left:.7rem; top:50%; transform:translateY(-50%); color:var(--muted); }
.search input{ width:100%; border:1.5px solid var(--line); border-radius:12px; padding:.5rem .7rem .5rem 2rem;
    font-weight:600; font-size:.88rem; transition:.2s; }
.search input:focus{ outline:none; border-color:var(--club); box-shadow:0 0 0 4px rgba(38,154,211,.14); }

/* Onglets de playlists */
.pl-tabs{ display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:.9rem;
    padding-bottom:.9rem; border-bottom:1.5px solid var(--line); }
.pl-tab{ display:inline-flex; align-items:center; gap:.45rem; background:#fff;
    border:1.5px solid var(--line); border-radius:999px; padding:.4rem .85rem;
    font-weight:700; font-size:.84rem; color:var(--ink); cursor:pointer; transition:.18s; }
.pl-tab:hover{ border-color:var(--club); color:var(--club-dk); }
.pl-tab .n{ background:var(--line); color:var(--muted); font-size:.72rem; font-weight:800;
    border-radius:999px; padding:.05rem .45rem; transition:.18s; }
.pl-tab.active{ background:var(--club); border-color:var(--club); color:#fff;
    box-shadow:0 6px 16px rgba(38,154,211,.28); }
.pl-tab.active .n{ background:rgba(255,255,255,.25); color:#fff; }

.tracks{ list-style:none; margin:0; padding:0; max-height:62vh; overflow-y:auto; }
.tracks[hidden]{ display:none; }
.tracks::-webkit-scrollbar{ width:8px; }
.tracks::-webkit-scrollbar-thumb{ background:var(--line); border-radius:999px; }
.tracks::-webkit-scrollbar-thumb:hover{ background:var(--club); }

.track{ display:flex; align-items:center; gap:.85rem; padding:.6rem .7rem; border-radius:12px;
    cursor:pointer; transition:.15s; border:1.5px solid transparent; }
.track:hover{ background:rgba(38,154,211,.06); }
.track .idx{ width:30px; flex:none; text-align:center; font-weight:800; color:var(--muted);
    font-variant-numeric:tabular-nums; font-size:.9rem; }
.track .idx .bi{ display:none; color:var(--club); }
.track .meta{ flex:1; min-width:0; }
.track .nm{ font-weight:700; font-size:.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.track .dur{ font-size:.78rem; font-weight:700; color:var(--muted); font-variant-numeric:tabular-nums; flex:none; min-width:42px; text-align:right; }
/* Badge "nombre de lectures" */
.track .plays{ display:inline-flex; align-items:center; gap:.3rem; flex:none; font-size:.74rem;
    font-weight:800; color:var(--club-dk); background:rgba(38,154,211,.10);
    border-radius:999px; padding:.12rem .5rem; font-variant-numeric:tabular-nums; }
.track .plays .bi{ font-size:.78rem; }
.track .plays.zero{ color:var(--muted); background:transparent; }
.track.active .plays{ background:rgba(255,140,0,.14); color:var(--accent-d); }

/* Piste active */
.track.active{ background:linear-gradient(135deg,rgba(38,154,211,.12),rgba(38,154,211,.04));
    border-color:rgba(38,154,211,.28); }
.track.active .nm{ color:var(--club-dk); }
.track.active .idx{ color:var(--club); }
.track.active .idx .num{ display:none; }
.track.active .idx .bi{ display:inline-block; }
/* Petites barres animées sur la piste active en lecture */
.player.is-playing ~ * .track.active .idx .bi{ animation:pulse 1s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }

.empty{ text-align:center; padding:2.5rem 1rem; color:var(--muted); }
.empty .bi{ font-size:2.6rem; color:var(--club); opacity:.6; }
.empty code{ background:var(--bg); padding:.15rem .45rem; border-radius:6px; color:var(--club-dk);
    font-weight:700; }

/* ------------------------------------------------------------------ */
/* Pied de page                                                        */
/* ------------------------------------------------------------------ */
.rb-foot{ background:var(--ink); color:rgba(255,255,255,.72); margin-top:2.4rem; }
.rb-foot .inner{ max-width:1180px; margin:0 auto; padding:1.3rem 1.1rem; display:flex;
    flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.8rem; font-size:.85rem; }
.rb-foot strong{ color:#fff; }
