/* Flowbox : une salle de cinéma dans la poche. Rideau de velours, laiton, billets. */
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url(/fonts/big-shoulders-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url(/fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url(/fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(/fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }

:root {
  --curtain: #2c0e19;
  --curtain-deep: #1d0911;
  --curtain-hi: #3d1727;
  --velvet: #8c2338;
  --brass: #d6a94f;
  --paper: #eadfc8;
  --teal: #1e5658;
  --plum: #57285c;
  --text: #f4e9d7;
  --muted: #bfa595;
  --line: rgba(244, 233, 215, .16);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: clamp(16px, 4vw, 40px);
  --bar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--curtain); color-scheme: dark; }
body {
  margin: 0; min-height: 100dvh; background: var(--curtain); color: var(--text);
  font: 400 1rem/1.5 var(--body);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

/* ── Boutons, états vides (aussi utilisés par l'écran de connexion) ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border: 0; border-radius: 8px;
  background: var(--brass); color: var(--curtain); font-weight: 600; text-decoration: none;
}
.btn:hover { background: #e2b962; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: rgba(244, 233, 215, .12); color: var(--text); }
.btn.ghost:hover { background: rgba(244, 233, 215, .2); }
.btn .ic { width: 1.15em; height: 1.15em; }
.btn.toggle[aria-pressed="true"] { background: rgba(214, 169, 79, .2); color: var(--brass); }
.empty { max-width: 34rem; padding: 40px 0; color: var(--muted); }
.empty h2 { font: 700 1.9rem/1.05 var(--display); color: var(--text); margin: 0 0 8px; }

/* ── Menu latéral (permanent sur grand écran, tiroir sur téléphone) ── */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 232px; display: flex; flex-direction: column; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 14px) 12px calc(env(safe-area-inset-bottom) + 14px);
  background: var(--curtain-deep); border-right: 1px solid var(--line);
}
.side .wordmark { padding: 6px 12px 16px; margin: 0; }
.side nav { display: grid; gap: 2px; }
.side a:not(.wordmark) { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; text-decoration: none; }
.side a:not(.wordmark):hover { color: var(--text); background: rgba(244, 233, 215, .06); }
.side a[aria-current="page"] { color: var(--text); background: var(--curtain-hi); }
.side a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--brass); }
.side-title { margin: 16px 14px 2px; color: var(--muted); font-size: .82rem; }
.side-libs { display: grid; gap: 2px; overflow-y: auto; min-height: 0; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.ic { width: 22px; height: 22px; flex: none; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .6); }
.shell-main { min-height: 100dvh; }

/* ── En-tête fixe : transparent sur les visuels, opaque après défilement ── */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  min-height: var(--bar-h); padding: calc(env(safe-area-inset-top) + 8px) var(--pad) 8px;
  background: linear-gradient(rgba(29, 9, 17, .85), rgba(29, 9, 17, 0));
}
.bar.solid { background: rgba(29, 9, 17, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.wordmark { font: 800 2rem/1 var(--display); letter-spacing: .01em; text-decoration: none; }
.bar .wordmark { font-size: 1.7rem; }
.menu-btn { display: none; width: 42px; height: 42px; margin-left: -8px; border: 0; border-radius: 8px; background: none; place-items: center; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search input {
  width: min(15rem, 42vw); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(29, 9, 17, .55); color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { background: var(--curtain-deep); }
.user { position: relative; }
.user-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--curtain-hi); font-weight: 600; text-transform: uppercase; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 12rem; padding: 6px; background: var(--curtain-deep);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #0009;
}
.user-menu p { margin: 0; padding: 8px 12px; color: var(--muted); font-size: .9rem; }
.user-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-radius: 6px; }
.user-menu button:hover { background: var(--curtain-hi); }

/* ── Pages ───────────────────────────────────────────── */
.page { max-width: 1500px; margin: 0 auto; }
.pad { padding-inline: var(--pad); }
.lead-page { padding-top: calc(var(--bar-h) + 28px); }
.page-title { font: 800 clamp(2.4rem, 5.5vw, 3.6rem)/.95 var(--display); margin: 0 0 6px; }
.count { color: var(--muted); font: 400 1rem var(--body); margin-left: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 22px; }
.toolbar select {
  appearance: none; padding: 10px 38px 10px 16px; border-radius: 8px; border: 1px solid var(--line); background-color: var(--curtain-hi); color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat;
}
.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding-bottom: 60px; }
.section-title { font: 700 1.7rem/1 var(--display); margin: 34px 0 14px; }

/* ── Affiches ────────────────────────────────────────── */
.card { display: block; min-width: 0; color: inherit; text-decoration: none; }
button.card { padding: 0; border: 0; background: none; text-align: left; font: inherit; }
.card-art { display: block; position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px; background: var(--curtain-hi); }
.card-art.wide { aspect-ratio: 16 / 9; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.card-art img.loaded { opacity: 1; }
.card:hover .card-art, .card:focus-visible .card-art { outline: 2px solid var(--brass); outline-offset: 2px; }
.card:focus-visible { outline: none; }
.card-title { margin-top: 8px; font-weight: 600; font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-sub { display: block; color: var(--muted); font-size: .82rem; }
.tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: var(--brass); color: var(--curtain); font-weight: 600; font-size: .75rem; }
.badge { position: absolute; top: 7px; right: 7px; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 12px; background: var(--brass); color: var(--curtain); font: 600 .78rem/1 var(--body); font-style: normal; }
.badge.ok { width: 24px; padding: 0; background: rgba(29, 9, 17, .88); color: var(--brass); border: 1px solid var(--brass); }
.badge .ic { width: 15px; height: 15px; }
.bar-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .55); }
.bar-progress i { display: block; height: 100%; background: var(--brass); }
@media (hover: hover) {
  .card-art::after {
    content: ""; position: absolute; inset: 0; opacity: 0;
    background: rgba(29, 9, 17, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='23' fill='%23d6a94f'/%3E%3Cpath d='M19 14v20l16-10z' fill='%232c0e19'/%3E%3C/svg%3E") center / 52px no-repeat;
  }
  .card:hover .card-art::after { opacity: 1; }
}

/* Tuile de bibliothèque : collage de quatre affiches */
.collage { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.collage > span { position: relative; overflow: hidden; }
.collage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.collage img.loaded { opacity: 1; }
.card-art.lib-art::after, .card:hover .card-art.lib-art::after { content: ""; position: absolute; inset: 0; opacity: 1; background: linear-gradient(0deg, rgba(29, 9, 17, .6), transparent 55%); }

/* Sans affiche : un billet typographique */
.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
  background: var(--bg, var(--velvet)); color: var(--on, var(--text));
}
/* padding-top / margin-top négatif : la coupe des titres longs (overflow) ne rogne plus l'accent d'un É majuscule */
.ph b { padding-top: .24em; margin-top: -.24em; font: 800 clamp(1.25rem, 2.2vw, 1.7rem)/.95 var(--display); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ph span { border-top: 2px dashed currentColor; padding-top: 6px; font-size: .8rem; opacity: .8; min-height: 1.8em; }
.card-art.wide .ph b { font-size: 1.3rem; }
.t0 { --bg: var(--velvet); --on: #f8ecda; }
.t1 { --bg: var(--brass);  --on: var(--curtain); }
.t2 { --bg: var(--teal);   --on: #f1eadb; }
.t3 { --bg: var(--plum);   --on: #f5e8f0; }
.t4 { --bg: var(--paper);  --on: var(--curtain-hi); }

/* ── Rangées défilantes ──────────────────────────────── */
.row { position: relative; margin: 30px 0 8px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 var(--pad); }
.row-head h2 { font: 700 1.7rem/1 var(--display); margin: 0; }
.row-head a { color: var(--muted); font-size: .92rem; }
.row-head a:hover { color: var(--text); }
.track { display: flex; gap: 14px; overflow-x: auto; padding: 14px var(--pad) 10px; scroll-snap-type: x proximity; scrollbar-width: none; scroll-padding-inline: var(--pad); }
.track::-webkit-scrollbar { display: none; }
.track > * { flex: 0 0 var(--cw, clamp(118px, 13vw, 176px)); scroll-snap-align: start; }
.track.wide > * { --cw: clamp(230px, 27vw, 340px); }
.arrow {
  position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(29, 9, 17, .85); color: var(--text);
  font-size: 1.6rem; line-height: 1; padding-bottom: 3px; display: none; margin-top: 10px;
}
.arrow.l { left: 8px; }
.arrow.r { right: 8px; }
@media (hover: hover) { .row:hover .arrow { display: block; } }

/* ── Visuel d'accueil ────────────────────────────────── */
.hero { position: relative; min-height: min(80vh, 760px); display: flex; align-items: flex-end; overflow: hidden; background: var(--curtain-deep); }
.hero-img, .detail-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; transition: opacity .9s ease; }
.hero-img.loaded, .detail-bg img.loaded { opacity: 1; }
/* Le dégradé du bas est la couche du dessus : en bas, la couleur est exactement celle de la page, donc aucune arête visible. */
.shade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--curtain) 0%, rgba(44, 14, 25, 0) 45%), linear-gradient(90deg, rgba(29, 9, 17, .94) 0%, rgba(29, 9, 17, .6) 42%, rgba(29, 9, 17, 0) 78%); }
.hero-body { position: relative; width: 100%; max-width: 1500px; margin: 0 auto; padding: calc(var(--bar-h) + 40px) var(--pad) clamp(28px, 6vh, 64px); }
.hero h1 { font: 800 clamp(3.2rem, 9vw, 7.2rem)/.86 var(--display); margin: 0 0 14px; max-width: 14ch; overflow-wrap: anywhere; text-wrap: balance; }
.hero p { max-width: 46ch; margin: 14px 0 22px; color: var(--paper); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Méta : séparateurs fins plutôt que points médians ── */
/* Séparateur = bordure gauche de chaque élément ; le conteneur décalé et rogné cache celui qui commence une ligne, même après retour à la ligne. */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin-left: -14px; overflow: hidden; color: var(--paper); }
.meta > * { margin-left: -1px; padding: 0 14px; border-left: 1px solid var(--line); }
.rating { color: var(--brass); font-weight: 600; }
.chips-inline { display: inline-flex; gap: 6px; }
.chip-q { padding: 1px 8px; border: 1px solid var(--brass); border-radius: 4px; color: var(--brass); font-size: .8rem; font-weight: 600; }

/* ── Fiche film / série ──────────────────────────────── */
.detail { position: relative; }
.detail-bg { position: absolute; inset: 0 0 auto 0; height: min(72vh, 620px); overflow: hidden; background: var(--curtain-deep); }
.detail-bg .shade { background: linear-gradient(0deg, var(--curtain) 0%, rgba(44, 14, 25, 0) 70%), linear-gradient(90deg, rgba(29, 9, 17, .88) 0%, rgba(29, 9, 17, .35) 60%, rgba(29, 9, 17, .1) 100%); }
.detail-body { position: relative; display: grid; grid-template-columns: minmax(150px, 250px) minmax(0, 1fr); gap: clamp(22px, 4vw, 48px); padding: calc(var(--bar-h) + clamp(60px, 16vh, 190px)) var(--pad) 10px; align-items: start; }
.detail-body.no-art { padding-top: calc(var(--bar-h) + 40px); }
.detail-poster .card-art { box-shadow: 0 18px 44px #000a; }
.detail-info h1 { font: 800 clamp(2.6rem, 6vw, 4.8rem)/.92 var(--display); margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
.orig { color: var(--muted); margin: 0 0 12px; }
.genres { color: var(--muted); margin: 12px 0 0; }
.tagline { color: var(--paper); margin: 16px 0 0; font-weight: 600; }
.overview { max-width: 64ch; margin: 12px 0 22px; color: var(--text); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; }
.seg button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: none; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--curtain); }
.note { max-width: 56ch; margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.tech { margin-top: 26px; color: var(--muted); font-size: .9rem; }
.tech summary { cursor: pointer; }
.tech dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 0; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.detail-more { position: relative; padding: 0 var(--pad) 60px; }

/* Distribution */
.cast { display: flex; gap: 18px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.cast::-webkit-scrollbar { display: none; }
.person { flex: 0 0 96px; text-align: center; font-size: .85rem; }
.avatar { position: relative; width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; overflow: hidden; background: var(--curtain-hi); display: grid; place-items: center; font: 800 1.6rem var(--display); color: var(--muted); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person b { display: block; font-weight: 600; line-height: 1.25; }
.person span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.25; margin-top: 2px; }

/* Saisons et épisodes */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: none; font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--curtain); }
.eps { display: grid; gap: 2px; }
.ep { position: relative; border-radius: 10px; }
.ep:hover, .ep:focus-within { background: var(--curtain-hi); }
.ep-play { display: grid; grid-template-columns: clamp(130px, 22vw, 240px) minmax(0, 1fr); gap: 18px; width: 100%; padding: 10px 56px 10px 10px; border: 0; border-radius: 10px; background: none; text-align: left; }
.ep-check { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(29, 9, 17, .6); color: var(--muted); }
.ep-check:hover { color: var(--text); border-color: var(--muted); }
.ep-check.on { color: var(--brass); border-color: var(--brass); }
.ep-check .ic { width: 18px; height: 18px; }
.ep-still { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--curtain-hi); }
.ep-still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.ep-still img.loaded { opacity: 1; }
.ep-num { position: absolute; left: 8px; bottom: 4px; font: 800 2.2rem/1 var(--display); text-shadow: 0 2px 10px #000; }
.ep-still.plain { display: grid; place-items: center; }
.ep-still.plain .ep-num { position: static; color: var(--muted); text-shadow: none; }
.ep-text { min-width: 0; align-self: center; }
.ep-text b { display: block; font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.ep-meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.ep-text p { margin: 6px 0 0; color: var(--paper); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Préférences ─────────────────────────────────────── */
.prefs { max-width: 46rem; margin: 0 auto; padding-bottom: 80px; }
.saved { margin-left: 14px; color: var(--brass); font: 600 .95rem var(--body); }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.pref-label { display: block; font-weight: 600; }
.pref-label small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: .85rem; max-width: 34ch; }
.pref select { appearance: none; min-width: 12rem; padding: 10px 36px 10px 14px; border-radius: 8px; border: 1px solid var(--line); background-color: var(--curtain-hi); color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.pref input[type="checkbox"] { width: 46px; height: 26px; appearance: none; border-radius: 13px; background: var(--curtain-hi); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; }
.pref input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); }
.pref input[type="checkbox"]:checked { background: var(--brass); border-color: var(--brass); }
.pref input[type="checkbox"]:checked::after { left: 23px; background: var(--curtain); }
.hint { color: var(--muted); max-width: 52ch; }

/* ── Bibliothèques : liste, fenêtres, navigateur de dossiers ── */
.btn.small { padding: 7px 14px; font-size: .9rem; }
.btn.danger { background: #b3382c; color: #fff; }
.btn.danger:hover { background: #c9453a; }
.danger-text { color: #ff9c8f; }
.libs { display: grid; margin: 8px 0 14px; }
.lib-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.lib-row > .ic { color: var(--brass); width: 26px; height: 26px; }
.lib-info { flex: 1; min-width: 0; }
.lib-info b { display: block; font-size: 1.05rem; }
.lib-path { display: block; color: var(--muted); overflow-wrap: anywhere; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.warn { color: #ffb4a8; }
.dlg { width: min(40rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--curtain-deep); color: var(--text); box-shadow: 0 24px 60px #000c; }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-body { flex: 1; min-height: 0; overflow-y: auto; padding: 5px; margin: 0 -5px; }
.dlg::backdrop { background: rgba(0, 0, 0, .65); }
.dlg h2 { margin: 0 0 8px; font: 800 1.9rem/1 var(--display); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line); flex: none; }
.field-row { display: block; margin: 16px 0; }
.field-row .pref-label { margin-bottom: 6px; }
.field-row input { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--curtain-hi); color: var(--text); }
.picker { border: 1px solid var(--line); border-radius: 10px; background: var(--curtain); overflow: hidden; }
.crumb { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.crumb-path { min-width: 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.folders { max-height: 15rem; overflow-y: auto; padding: 4px; }
.folder { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; text-align: left; }
.folder:hover, .folder:focus-visible { background: var(--curtain-hi); }
.folder .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.picker-foot { max-width: none; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .lib-row { flex-wrap: wrap; } .lib-actions { justify-content: flex-start; width: 100%; } .dlg { padding: 18px; } .folders { max-height: 11rem; } .dlg h2 { font-size: 1.6rem; } }

/* ── Connexion, serveur injoignable ──────────────────── */
.login { max-width: 26rem; margin: 0 auto; padding: 14vh var(--pad) 40px; }
.login h1 { font: 800 4rem/.9 var(--display); margin: 0 0 8px; }
.login p { color: var(--muted); margin: 0 0 26px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 13px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--curtain-hi); color: var(--text); }
.error { color: #ffb4a8; min-height: 1.5em; margin: 0 0 6px; }

/* ── Lecteur ─────────────────────────────────────────── */
.player { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; }
.player video { width: 100%; height: 100%; background: #000; object-fit: contain; }
/* Sous-titres dessinés par Flowbox : au-dessus des commandes quand elles sont visibles, plus bas quand elles se masquent. */
.p-cues { position: absolute; left: 6vw; right: 6vw; bottom: 132px; z-index: 1; display: grid; justify-items: center; gap: 2px; text-align: center; pointer-events: none; transition: bottom .2s; }
.p-ui.idle ~ .p-cues { bottom: 6vh; }
.p-cues div { max-width: 100%; padding: 2px 12px; border-radius: 4px; background: rgba(0, 0, 0, .72); color: #fff; font: 600 var(--cue, 1.6rem)/1.35 var(--body); text-shadow: 0 1px 3px #000; white-space: pre-line; overflow-wrap: anywhere; }
.p-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; transition: opacity .2s; }
.p-ui.idle { opacity: 0; cursor: none; }
.p-ui.idle * { pointer-events: none; }
.p-top, .p-bottom { position: relative; z-index: 2; padding-left: calc(env(safe-area-inset-left) + 14px); padding-right: calc(env(safe-area-inset-right) + 14px); }
.p-top { display: flex; align-items: center; gap: 10px; padding-top: calc(env(safe-area-inset-top) + 10px); padding-bottom: 34px; background: linear-gradient(rgba(0, 0, 0, .8), transparent); }
.p-bottom { padding-top: 38px; padding-bottom: calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.p-titles { min-width: 0; }
.p-title { font: 800 1.5rem/1.05 var(--display); text-shadow: 0 1px 6px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { color: var(--paper); font-size: .9rem; }
.p-mid { flex: 1; display: grid; place-items: center; }
.p-msg { max-width: min(28rem, 88vw); background: var(--curtain); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; text-align: center; }
.p-toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 3; max-width: 90vw; padding: 9px 16px; border-radius: 999px; background: rgba(29, 9, 17, .92); border: 1px solid var(--line); font-size: .92rem; }
.p-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--brass); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-btn { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: none; color: #fff; }
.p-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.p-btn:disabled { opacity: .35; cursor: default; }
.p-btn.big .ic { width: 30px; height: 30px; }
.p-btn.on { color: var(--brass); }
.p-btn.back .ic { width: 30px; height: 30px; }
.p-row { display: flex; align-items: center; gap: 2px; }
.p-grow { flex: 1; }
.p-time { margin: 0 10px; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-vol { width: 84px; accent-color: var(--brass); }
.p-seek { position: relative; height: 26px; margin-bottom: 4px; cursor: pointer; touch-action: none; }
.p-rail { position: absolute; left: 0; right: 0; top: 11px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.p-seek:hover .p-rail, .p-seek:focus-visible .p-rail { top: 9px; height: 9px; }
.p-buf { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 255, 255, .35); }
.p-played { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brass); }
.p-thumb { position: absolute; top: 5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.p-tip { position: absolute; bottom: 26px; transform: translateX(-50%); padding: 3px 8px; border-radius: 4px; background: rgba(0, 0, 0, .85); font-size: .8rem; font-variant-numeric: tabular-nums; pointer-events: none; }
.p-menu { position: absolute; z-index: 5; right: calc(env(safe-area-inset-right) + 14px); bottom: 92px; width: min(20rem, calc(100vw - 28px)); max-height: min(28rem, 60vh); overflow-y: auto; padding: 8px;
  background: rgba(29, 9, 17, .97); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px #000c; }
.p-group + .p-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.p-group h3 { margin: 6px 10px 4px; font: 600 .82rem var(--body); color: var(--muted); }
.p-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.p-item:hover:not(:disabled), .p-item:focus-visible { background: var(--curtain-hi); }
.p-item:disabled { opacity: .45; cursor: default; }
.p-item small { margin-left: auto; color: var(--muted); }
.p-check { width: 20px; flex: none; color: var(--brass); }
.p-check .ic { width: 18px; height: 18px; }

/* ── Petits écrans ───────────────────────────────────── */
@media (max-width: 720px) {
    .search input { width: 9rem; }
  .p-vol { display: none; }
  .p-time { margin: 0 4px; font-size: .8rem; }
  .p-btn { width: 40px; height: 40px; }
  .p-title { font-size: 1.2rem; }
  .p-menu { bottom: 86px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 10px; }
  .shade { background: linear-gradient(0deg, var(--curtain) 4%, rgba(29, 9, 17, .55) 45%, rgba(29, 9, 17, .25) 100%); }
  .hero { min-height: 68vh; }
  .detail-body { grid-template-columns: 1fr; padding-top: calc(var(--bar-h) + 34vw); }
  .detail-poster { display: none; }
  .detail-bg .shade { background: linear-gradient(0deg, var(--curtain) 8%, rgba(29, 9, 17, .3) 100%); }
  .ep-play { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 8px 48px 8px 4px; }
  .ep-check { top: 8px; right: 4px; }
  .ep-num { font-size: 1.6rem; }
}
@media (max-width: 999px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: none; }
  .side.open { transform: none; box-shadow: 0 0 40px #000; }
  .menu-btn { display: grid; }
}
@media (min-width: 1000px) {
  .shell-main { margin-left: 232px; }
  .bar { left: 232px; }
  .bar .wordmark { display: none; }
  .scrim { display: none; }
}
@media (min-width: 721px) { .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 18px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
