/* Clipote — thème sombre, pensé d'abord pour le mobile,
   puisque tout le monde ouvrira le lien depuis WhatsApp. */

:root {
    --bg:      #0b0b0f;
    --surface: #16161d;
    --surface2:#1e1e28;
    --line:    #2a2a36;
    --text:    #f2f2f5;
    --muted:   #9a9aa8;
    --accent:  #ff3b5c;
    --ok:      #2fbf71;
    --radius:  12px;
}

* { box-sizing: border-box; }

/* Les règles d'affichage plus bas (display:flex, display:grid) l'emportent
   sinon sur le display:none que le navigateur associe à l'attribut hidden,
   et les éléments masqués par le JS restent visibles. */
[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.wrap.center { text-align: center; padding-top: 80px; }

h1, h2 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.section { margin: 28px 0 12px; }

/* ---------- Boutons ---------- */

.btn {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { border-color: #3a3a4a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: #5a2230; color: #ff7b90; }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

.icon {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface2);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
}

.icon:disabled { opacity: 0.3; cursor: default; }
.icon.on { border-color: var(--accent); color: var(--accent); }
.icon.danger { color: #ff7b90; }

/* ---------- Formulaires ---------- */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0f0f16;
    color: var(--text);
    font: inherit;
}

input:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

textarea { resize: vertical; min-height: 110px; }

label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--muted);
}

label input { margin-top: 6px; color: var(--text); }

.stack > button { margin-top: 4px; }

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.row input[type="text"] { flex: 1 1 220px; width: auto; }

/* ---------- Cartes, pages membres et console ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}

.card.narrow { max-width: 420px; margin: 60px auto; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand span { color: var(--accent); }
.brand.big { font-size: 2rem; }

.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

.alert {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    margin: 0 0 18px;
    font-size: 0.92rem;
}

.alert.ok  { border-color: #1f5a3c; }
.alert.err { border-color: #5a2230; color: #ffb3c0; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
}

.tile:hover { border-color: var(--accent); }
.tile code { color: var(--muted); font-size: 0.8rem; margin-top: 6px; }
.tile .muted { font-size: 0.85rem; }

.share .linkbox {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    margin-bottom: 12px;
    cursor: pointer;
}

.videolist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.videolist li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.videolist img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    flex: none;
    background: #000;
}

.videolist .meta { flex: 1; min-width: 0; }
.videolist .rename input { border-color: transparent; background: transparent; padding: 4px 6px; }
.videolist .rename input:hover { border-color: var(--line); }
.videolist .tools { display: flex; gap: 6px; flex: none; }
.videolist .tools form { display: contents; }

.danger-zone { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Page de lecture ----------
   Écrit mobile d'abord : la quasi-totalité des visiteurs arrivent d'un lien
   WhatsApp, sur un téléphone tenu à une main. La mise en page à deux colonnes
   n'apparaît qu'au-dessus de 980px. */

.player-page { background: var(--bg); }

.app {
    display: block;
    max-width: 1280px;
    margin: 0 auto;
}

/* ---------- Scène : pochette + transport ---------- */

.stage {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #000;
}

.frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.frame .ytbox,
.frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Mode audio : la pochette masque la vidéo ----------
   L'iframe reste en place et continue de jouer : on la recouvre, on ne la
   cache jamais en display:none, ce qui couperait la lecture sur certains
   navigateurs. */

.cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: #05050a;
    overflow: hidden;
}

/* Trois affichages exclusifs dans le cadre : pochette, visualisation, vidéo.
   Dans les deux premiers, l'iframe joue toujours, simplement recouverte. */
.cover, .scope { display: none; }
.mode-cover .cover { display: grid; }
.mode-scope .scope { display: block; }

.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) saturate(1.4) brightness(0.55);
    transform: scale(1.25);
}

.scope {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: #08080d;
}

/* Réglages de la visualisation : seconde ligne sous le transport, visible
   uniquement dans ce mode. */
.viewbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.viewbar select {
    flex: 1 1 130px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
}

.viewbar input[type="range"] {
    flex: 1 1 110px;
    min-width: 90px;
    accent-color: var(--accent);
}

.viewbar .btn.on { border-color: var(--accent); color: var(--accent); }

.livestatus {
    flex: 1 1 100%;
    line-height: 1.35;
}

/* Barres d'égaliseur : le seul signe visible que le son tourne en mode audio. */
.bars {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 46px;
}

.bars i {
    display: block;
    width: 7px;
    height: 10px;
    border-radius: 4px;
    background: var(--accent);
    opacity: 0.45;
}

.is-playing .bars i { animation: bounce 1s ease-in-out infinite; }
.is-playing .bars i:nth-child(2) { animation-delay: 0.15s; }
.is-playing .bars i:nth-child(3) { animation-delay: 0.3s; }
.is-playing .bars i:nth-child(4) { animation-delay: 0.45s; }
.is-playing .bars i:nth-child(5) { animation-delay: 0.6s; }

@keyframes bounce {
    0%, 100% { height: 10px; opacity: 0.45; }
    50%      { height: 42px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .is-playing .bars i { animation: none; height: 26px; opacity: 0.8; }
}

/* ---------- Écran de départ ---------- */

.start {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    border: 0;
    padding: 0;
    color: #fff;
    font: inherit;
    cursor: pointer;
    background-color: #000;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 100vmax rgba(0, 0, 0, 0.58);
}

.start .play {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--accent);
    font-size: 1.8rem;
    padding-left: 5px;
}

.start .label {
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
    padding: 0 20px;
    text-align: center;
}

.start:disabled { cursor: progress; }
.start:disabled .play { background: var(--surface2); color: var(--muted); }

.notice {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(10, 10, 14, 0.94);
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}

.notice p { margin: 0; flex: 1 1 200px; }

/* ---------- Barre de transport ---------- */

.nowbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.now { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.now .idx { color: var(--accent); font-weight: 700; font-size: 0.85rem; flex: none; }
.now .meta { min-width: 0; display: flex; flex-direction: column; }

.now .title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now .author {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cibles tactiles : 48px minimum, on joue au pouce dans le métro. */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.controls .icon {
    min-width: 48px;
    height: 48px;
    font-size: 1.15rem;
}

.controls .play-toggle {
    min-width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-size: 1.35rem;
}

.controls .play-toggle.on { background: var(--accent); }
.controls .play-toggle:disabled { background: var(--surface2); border-color: var(--line); }

/* ---------- Colonne playlist ---------- */

.side { padding: 18px 14px 48px; }

.plhead { margin-bottom: 14px; }
.plhead h1 { font-size: 1.25rem; margin-bottom: 6px; }
.plhead p { margin: 0 0 2px; }
.plhead .count { color: var(--muted); }

.tracklist { list-style: none; margin: 0; padding: 0; }

.tracklist button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tracklist button:hover { background: var(--surface2); }

.tracklist button.active {
    border-color: var(--accent);
    background: var(--surface2);
}

.tracklist .num {
    width: 22px;
    flex: none;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.tracklist button.active .num { color: var(--accent); font-weight: 700; }

.tracklist .thumb { position: relative; flex: none; line-height: 0; }

.tracklist img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

/* Pastille de lecture sur la vignette du clip en cours. */
.tracklist button.active .thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
}

.is-playing .tracklist button.active .thumb::before {
    content: "▶";
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.1rem;
}

.tracklist .txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.tracklist .t {
    font-weight: 600;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tracklist .a { color: var(--muted); font-size: 0.8rem; }

.plfoot {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.plfoot p { margin: 10px 0 0; }

/* ---------- Deux colonnes sur grand écran ---------- */

@media (min-width: 980px) {
    .app {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 400px;
        gap: 24px;
        padding: 24px;
        align-items: start;
    }

    .stage {
        top: 24px;
        border-radius: var(--radius);
        overflow: hidden;
        border: 1px solid var(--line);
    }

    .nowbar {
        flex-direction: row;
        align-items: center;
        border-bottom: 0;
    }

    .now { flex: 1; }
    .controls { flex: none; }

    /* La liste défile toute seule, la scène reste fixe à côté. */
    .side {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        padding: 0 4px 0 0;
    }
}

/* ---------- Plateforme : navigation, galerie, console ----------
   Ajouté avec les comptes membres. Le lecteur garde sa propre mise en page
   plein écran, tout le reste du site passe par .app-page. */

.app-page { padding-top: 0; }
.wrap.wide { max-width: 1100px; }

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topnav .brand { font-size: 1.05rem; }
.topnav .links {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.topnav .links a { color: var(--muted); text-decoration: none; }
.topnav .links a:hover { color: var(--text); }
.topnav .links a.on { color: var(--text); font-weight: 600; }
.topnav .links a.btn { color: var(--text); }
.topnav .links a.primary { color: #fff; }
.topnav .me { font-weight: 600; color: var(--text) !important; }

/* Pastille du nombre de propositions en attente. */
.dot {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}

.sitefoot {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 22px 16px 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.sitefoot a { color: var(--muted); text-decoration: none; }
.sitefoot a:hover { color: var(--text); }

.pagehead { margin-bottom: 22px; }
.pagehead .lead { font-size: 1.05rem; margin: 0 0 10px; }
.pagehead.hero { text-align: center; padding: 26px 0 8px; }
.pagehead.hero h1 { font-size: 2rem; letter-spacing: -0.02em; }
.hl { color: var(--accent); }
.block { display: block; }

.searchbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.searchbar input { flex: 1 1 240px; width: auto; }

/* ---------- Vignettes de playlist ---------- */

.grid.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.pcard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 0 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    overflow: hidden;
}

.pcard:hover { border-color: var(--accent); }

.pcover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 8px;
}

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

.pcover .empty {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 2rem;
    color: var(--muted);
    background: var(--surface2);
}

.pcover .count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    font-size: 0.75rem;
}

.pcard strong,
.pcard .desc,
.pcard .by,
.pcard .badges { padding: 0 14px; }

.pcard .desc,
.pcard .by {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcard .badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

/* ---------- Étiquettes ---------- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.v-publique { border-color: #1f5a3c; color: #7fe0ae; }
.badge.v-privee   { border-color: #45455a; }
.badge.c-ouvert   { border-color: #2c4a6e; color: #8fc4ff; }
.badge.c-revue    { border-color: #5a4a1f; color: #e8c877; }
.badge.pending,
.badge.danger     { border-color: #5a2230; color: #ffb3c0; }
.badge.s-acceptee { border-color: #1f5a3c; color: #7fe0ae; }
.badge.s-refusee  { color: var(--muted); }

/* ---------- Choix visibilité / contribution ---------- */

.choices {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px 4px;
    margin: 0 0 16px;
}

.choices legend { padding: 0 6px; font-size: 0.85rem; color: var(--muted); }

.choice,
.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    cursor: pointer;
    color: var(--text);
}

.choice input,
.check input { margin: 3px 0 0; flex: none; }
.choice span span,
.check span span { display: block; }
.choice strong,
.check strong { font-weight: 600; }

.hint { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }

.card.highlight { border-color: var(--accent); }

/* ---------- Propositions en attente ---------- */

.suglist { list-style: none; margin: 0; padding: 0; }

.suglist li {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.suglist li:first-child { border-top: 0; }
.suglist img { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; flex: none; background: #000; }
.suglist .meta { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.suglist .tools { display: flex; gap: 6px; flex: none; }
.sugmsg { font-size: 0.88rem; font-style: italic; }

/* Encart de contribution dans le lecteur. */
.contrib {
    margin: 18px 0 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.contrib h2 { font-size: 1rem; }
.contrib input { margin-bottom: 8px; }
.plnav { margin-top: 10px; }

/* ---------- Tableaux de la console ---------- */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 18px;
    display: block;
    overflow-x: auto;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.table tr.off { opacity: 0.55; }
.table .inline { display: inline-flex; gap: 4px; align-items: center; }
.table .rowtools { display: flex; flex-wrap: wrap; gap: 6px; }
.table .rowtools input[type="text"] { width: 120px; padding: 6px 8px; }
.table code { color: var(--muted); }

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.tabs a {
    padding: 9px 14px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 26px;
}

.stat {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat strong { display: block; font-size: 1.7rem; line-height: 1.1; }

.notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.notes li { margin-bottom: 6px; }

.alert.warn { border-color: #5a4a1f; color: #e8c877; }

.card.center { text-align: center; }

/* ---------- Marque ----------
   Le « p » de Clipote est la seule fantaisie typographique du site. */

.bp {
    color: var(--accent);
    font-weight: 800;
    font-style: italic;
}

/* ---------- Bandeau de la page de lecture ----------
   Le lecteur n'a pas la navigation du reste du site : juste la marque et une
   sortie. Il défile avec la page, la scène du lecteur garde le rôle sticky. */

.plbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.plbar .brand {
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

@media (min-width: 980px) {
    /* Toute la largeur, au-dessus des deux colonnes. */
    .plbar {
        grid-column: 1 / -1;
        padding: 0 0 14px;
        background: none;
    }
}
