/* Nexis — feuille de style unique (direction « Grand écran ») */
@font-face { font-family: "Outfit"; src: url("/fonts/outfit.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff") format("woff"); font-weight: 100 900; font-display: swap; }
:root {
  --accent: #ffa43a;
  --bg: #0b0b0e;
  --surface: #131317;
  --surface-2: #1c1c22;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f3ef;
  --muted: #a6a3ae;
  --ink-on-accent: #1c0f00;
  --danger: #e5484d;
  --ok: #3dd68c;
  --radius: 10px;
  --topbar-h: 76px;
  --safe-top: 0px; /* hauteur de la barre d'état de l'iPhone dans l'application installée */
  --poster-w: 160px;
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
:root[data-theme="oled"] { --bg: #000; --surface: #0c0c0e; --surface-2: #161619; }
:root[data-theme="light"] {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #ebe8e1; --line: rgba(0, 0, 0, 0.09);
  --text: #16161a; --muted: #5f6068; --ink-on-accent: #1c0f00; color-scheme: light;
}
:root[data-poster="s"] { --poster-w: 128px; }
:root[data-poster="l"] { --poster-w: 200px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- boot / logo ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font: 800 24px var(--display); letter-spacing: -0.01em; flex: none; }
.logo-mark { width: 36px; height: 36px; flex: none; background: url("/img/nexis-logo.webp") center/contain no-repeat; }
.logo-mark.big { width: 96px; height: 96px; }
.boot .logo-mark { animation: pulse 1.4s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(255, 138, 31, 0.4)); }
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.96); } }
h1, h2, h3, .row-title { font-family: var(--display); letter-spacing: -0.01em; }

/* ---------- buttons & form ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 600;
  transition: transform 0.12s, background 0.15s, filter 0.15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }
.btn.ghost { background: rgba(255, 255, 255, 0.12); border-color: transparent; backdrop-filter: blur(8px); }
.btn.light { background: #fff; color: #0b0b0e; border-color: transparent; }
.btn.lg { padding: 0 28px; height: 54px; font: 700 17px var(--display); }
:root[data-theme="light"] .btn.ghost { background: rgba(0, 0, 0, 0.06); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
input:not([type="checkbox"]):not([type="range"]), select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color 0.15s; }
input:focus, select:focus { border-color: var(--accent); }
input:disabled { opacity: 0.6; }
input[type="range"] { accent-color: var(--accent); }
.form-error { color: var(--danger); min-height: 1em; margin: 4px 0 12px; font-size: 14px; }
.warn-text { color: var(--accent); margin-top: 4px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 10px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line);
  position: relative; flex: none; transition: background 0.15s; }
.toggle-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); background: var(--ink-on-accent); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.inline { display: flex; align-items: center; gap: 12px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  max-width: 480px; margin: 40px auto; text-align: center; }
.empty { color: var(--muted); padding: 60px 0; text-align: center; }

/* ---------- auth (connexion, installation) ---------- */
.auth-page { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--bg); }
.auth-stage { flex: 999 1 520px; min-width: 0; position: relative; overflow: hidden; min-height: 380px; background: #0b0b0e; color: #f5f3ef; }
.auth-wall { position: absolute; inset: -60px -40px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px;
  transform: rotate(-6deg) scale(1.08); opacity: 0.6; }
.auth-wall span { aspect-ratio: 2 / 3; border-radius: 12px; background: var(--c, #1c1c22); }
.auth-stage::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 14, 0.55), rgba(11, 11, 14, 0.85)), linear-gradient(0deg, #0b0b0e 0%, transparent 55%); }
.auth-stage-body { position: relative; z-index: 1; height: 100%; min-height: 380px; padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-stage .logo { font-size: 28px; }
.auth-stage .logo .logo-mark { width: 46px; height: 46px; }
.auth-pitch { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.auth-pitch h2 { font: 800 clamp(36px, 5vw, 60px)/1.02 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.auth-pitch p { margin: 0; font-size: 17px; line-height: 1.55; color: #c6c3cc; max-width: 46ch; }
.auth-side { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 5vw, 64px); background: var(--surface); border-left: 1px solid var(--line); }
.auth-card { width: 100%; max-width: 400px; }
.auth-lang { align-self: flex-end; margin: -8px 0 16px; }
.auth-lang select { width: auto; padding: 6px 10px; font-size: 14px; }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 8px; }
.auth-brand .logo-mark { width: 76px; height: 76px; filter: drop-shadow(0 0 22px rgba(255, 138, 31, 0.35)); }
.auth-brand h1 { font: 700 34px var(--display); letter-spacing: -0.02em; }
.auth-lead { color: var(--muted); margin: 6px 0 24px; }
.auth-card input:not([type="checkbox"]) { height: 50px; padding: 0 16px; font-size: 15px; }
.auth-card .btn.primary.block { height: 52px; margin-top: 6px; font: 700 17px var(--display); }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .auth-stage { flex-basis: 100%; min-height: 260px; }
  .auth-stage-body { min-height: 260px; }
  .auth-pitch h2 { font-size: 34px; }
  .auth-pitch p { display: none; }
  .auth-side { border-left: 0; flex-basis: 100%; }
  .auth-side .auth-brand .logo-mark { display: none; }
}
.step { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 26px 0 12px; }
.step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: var(--ink-on-accent); font-size: 13px; }
.or-split { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.status-box { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; background: var(--surface-2); }
.status-box:empty { display: none; }
.status-box.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); }
.status-box.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  min-height: calc(var(--topbar-h) + var(--safe-top)); padding: calc(12px + var(--safe-top)) var(--gutter) 12px; background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
  transition: background 0.25s, box-shadow 0.25s; }
.topbar.scrolled { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line); }
:root[data-theme="light"] .topbar:not(.scrolled) { background: linear-gradient(color-mix(in srgb, var(--bg) 90%, transparent), transparent); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav-link { position: relative; padding: 8px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid transparent;
  border-radius: 99px; padding: 0 14px; color: var(--muted); backdrop-filter: blur(8px); transition: border-color 0.15s; }
.search:focus-within { border-color: var(--accent); }
:root[data-theme="light"] .search { background: rgba(0, 0, 0, 0.06); }
.search input.search-input { border: 0; background: transparent; padding: 8px 0; width: 180px; outline: none; }
.user-wrap { position: relative; }
.user-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #111; font-weight: 700; flex: none;
  position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px;
  border: 0; background: none; cursor: pointer; }
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.user-menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px 12px; border-bottom: 1px solid var(--line);
  margin-bottom: 6px; }
.banner-error { background: color-mix(in srgb, var(--danger) 20%, var(--bg)); padding: 10px var(--gutter); font-size: 14px; }
.content { padding: 8px var(--gutter) 80px; }
.page-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 16px 0 24px; }
.page-head h1 { font: 800 34px var(--display); letter-spacing: -0.02em; }
.filters { display: flex; gap: 10px; margin-left: auto; }
.filters select { width: auto; }

/* ---------- hero ---------- */
.hero { position: relative; margin: calc(-8px - var(--topbar-h) - var(--safe-top)) calc(var(--gutter) * -1) 12px; min-height: min(82vh, 760px);
  display: flex; align-items: flex-end; background: var(--surface) center 20%/cover no-repeat; overflow: hidden; color: #f5f3ef; }
.hero-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 14, 0.92) 0%, rgba(11, 11, 14, 0.55) 38%, transparent 70%),
              linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 22%, transparent 50%); }
.hero-body { position: relative; padding: 0 var(--gutter) clamp(40px, 7vh, 72px); max-width: 700px; }
.hero-kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 700; color: var(--accent); }
.hero-title { font: 800 clamp(40px, 6.2vw, 80px)/0.98 var(--display); letter-spacing: -0.035em; margin: 12px 0 14px; text-wrap: balance; }
.hero-sub { color: #d6d3dc; margin: 0 0 8px; font-size: 16px; }
.hero-summary { color: #dad7df; margin: 0 0 24px; font-size: 17px; line-height: 1.55; max-width: 56ch;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn.ghost { color: #fff; }

/* ---------- rows & cards ---------- */
.row { margin-bottom: 30px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.row-title { font-size: 22px; font-weight: 700; }
a.row-title:hover { color: var(--accent); }
.row-nav { display: flex; gap: 4px; }
.row-track { display: grid; grid-auto-flow: column; grid-auto-columns: var(--poster-w); gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  /* une rangée qui défile coupe tout ce qui dépasse : marge pour l'affiche sélectionnée (soulevée, agrandie,
     cadre de 3 px à 3 px), compensée par une marge négative pour ne rien décaler */
  padding: 16px 16px 12px; margin: -16px -16px -4px; scroll-padding-inline: 16px; }
.row-track::-webkit-scrollbar { display: none; }
.wide-row .row-track { grid-auto-columns: calc(var(--poster-w) * 1.75); }
.card { display: block; scroll-snap-align: start; min-width: 0; }
.card-img { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s; }
.card.wide .card-img { aspect-ratio: 16 / 9; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-img, .card:focus-visible .card-img { transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 0 2px var(--accent), 0 18px 40px rgba(0, 0, 0, 0.45); }
.card:focus-visible { outline: none; }
.card-title { margin-top: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--muted);
  font: 600 15px var(--display); background: var(--surface-2); }
.badge { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.badge.count { background: var(--accent); color: var(--ink-on-accent); }
.badge.done { background: rgba(0, 0, 0, 0.65); color: var(--accent); padding: 0; }
.badge.done .icon { width: 16px; height: 16px; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, 0.55); }
.progress-fill { height: 100%; background: var(--accent); }
.play-hover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35);
  opacity: 0; transition: opacity 0.2s; }
.play-hover .icon { width: 46px; height: 46px; padding: 10px; border-radius: 50%; background: var(--accent); fill: var(--ink-on-accent); }
.card:hover .play-hover, .episode-thumb:hover .play-hover { opacity: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--poster-w), 1fr)); gap: 22px 16px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(calc(var(--poster-w) * 0.8), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(calc(var(--poster-w) * 1.6), 1fr)); }
.sentinel { min-height: 40px; }

/* ---------- detail page ---------- */
.detail { position: relative; margin: calc(-8px - var(--topbar-h) - var(--safe-top)) calc(var(--gutter) * -1) 10px;
  padding: calc(var(--topbar-h) + var(--safe-top) + 40px) var(--gutter) 30px; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0; background: var(--backdrop, none) center/cover no-repeat; opacity: 0.45;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); }
.detail-backdrop::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 10%, transparent 80%); }
.detail-inner { position: relative; display: flex; gap: 36px; align-items: flex-start; }
.detail-poster { width: min(30vw, 260px); flex: none; border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 3;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5); background: var(--surface); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { max-width: 760px; }
.detail-kicker { color: var(--accent); font-weight: 700; letter-spacing: 0.04em; }
.detail-title { font: 800 clamp(32px, 4.6vw, 60px)/1.02 var(--display); letter-spacing: -0.03em; margin: 6px 0 12px; text-wrap: balance; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-weight: 600; font-size: 14px; }
.tagline { font: 500 18px var(--display); color: var(--muted); margin: 14px 0 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.summary { font-size: 16px; line-height: 1.65; max-width: 68ch; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.chip { padding: 4px 12px; border-radius: 99px; background: var(--surface-2); font-size: 13px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 18px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.block { margin: 34px 0; }
.block > h2 { font-size: 19px; margin-bottom: 14px; }
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.person { display: flex; gap: 10px; align-items: center; }
.person-init { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center;
  font: 700 16px var(--display); flex: none; }
.season-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.season-head .tabs { margin: 0; }
.tab { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: none; cursor: pointer;
  white-space: nowrap; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tab.active { background: var(--text); color: var(--bg); border-color: transparent; }
.tab-done .icon { width: 14px; height: 14px; fill: var(--accent); }
.episodes { display: flex; flex-direction: column; gap: 4px; }
.episode { display: flex; gap: 18px; padding: 12px; border-radius: 12px; align-items: flex-start; }
.episode:hover { background: var(--surface); }
.episode-thumb { position: relative; width: 220px; flex: none; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode.watched .episode-thumb img { filter: saturate(0.4) brightness(0.75); }
.episode-head { display: flex; align-items: center; gap: 12px; }
.episode-title { font-weight: 700; font-size: 16px; flex: 1; }
.episode-title:hover { color: var(--accent); }
.episode-summary { color: var(--muted); font-size: 14px; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.watch-toggle.on { color: var(--accent); }

/* ---------- history / settings / admin ---------- */
.stats { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; min-width: 160px; }
.stat strong { display: block; font: 800 28px var(--display); color: var(--accent); }
.stat span { color: var(--muted); font-size: 13px; }
.history-day { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 24px 0 8px; }
.history-day::first-letter { text-transform: uppercase; }
.history-item { display: flex; gap: 14px; align-items: center; padding: 8px; border-radius: 10px; }
.history-item:hover { background: var(--surface); }
.history-item.gone { opacity: 0.55; }
.history-thumb { width: 120px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-body { flex: 1; min-width: 0; }
.panels { display: grid; gap: 18px; max-width: 900px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.panel h2 { font-size: 18px; margin-bottom: 16px; }
.profile-row { display: flex; gap: 22px; align-items: flex-start; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); }
.swatch.on { border-color: var(--text); transform: scale(1.1); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.user-list { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.user-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; }
.user-row.off { opacity: 0.55; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; margin-right: 6px;
  background: var(--surface-2); text-transform: uppercase; letter-spacing: 0.05em; }
.tag.accent { background: var(--accent); color: var(--ink-on-accent); }
.admin-body { max-width: 900px; }

/* ---------- modal & toast ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center;
  padding: 16px; backdrop-filter: blur(4px); }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 4px; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 12px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 20px 20px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex;
  flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface-2); color: var(--text); padding: 10px 18px; border-radius: 99px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: toast-in 0.2s ease-out; transition: opacity 0.4s; font-size: 14px; }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.bad { border-left: 4px solid var(--danger); }
.toast.out { opacity: 0; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

/* ---------- player ---------- */
body.playing { overflow: hidden; background: #000; }
.player { position: fixed; inset: 0; background: #000; color: #fff; overflow: hidden; user-select: none; }
.player .video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.idle { cursor: none; }
.player-top, .controls { position: absolute; left: 0; right: 0; transition: opacity 0.3s, transform 0.3s; z-index: 5; }
.player.idle .player-top, .player.idle .controls { opacity: 0; pointer-events: none; }
.player.idle .player-top { transform: translateY(-10px); }
.player.idle .controls { transform: translateY(10px); }
.player-top { top: 0; display: flex; align-items: center; gap: 14px; padding: 18px clamp(16px, 3vw, 36px) 50px;
  background: linear-gradient(rgba(0, 0, 0, 0.75), transparent); }
.player-title { display: flex; flex-direction: column; min-width: 0; }
.player-title strong { font: 700 20px var(--display); }
.player-title span { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.controls { bottom: 0; padding: 60px clamp(16px, 3vw, 36px) 18px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); }
.ctl-row { display: flex; align-items: center; gap: 6px; }
.ctl { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: #fff;
  cursor: pointer; border-radius: 50%; }
.ctl:hover { background: rgba(255, 255, 255, 0.12); }
.ctl .icon { width: 26px; height: 26px; }
.time { font-variant-numeric: tabular-nums; font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-left: 8px; white-space: nowrap; }
.vol { display: flex; align-items: center; }
.volume { width: 0; opacity: 0; transition: width 0.2s, opacity 0.2s; }
.vol:hover .volume, .volume:focus { width: 90px; opacity: 1; }
.timeline { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin-bottom: 4px; }
.tl-track { position: relative; width: 100%; height: 4px; background: rgba(255, 255, 255, 0.2); border-radius: 4px; transition: height 0.15s; }
.timeline:hover .tl-track { height: 7px; }
.tl-buffered { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.3); border-radius: 4px; }
.tl-intro { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.tl-played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.tl-thumb { display: none; }
.tl-played::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transform: translateY(-50%) scale(0); transition: transform 0.15s; }
.timeline:hover .tl-played::after { transform: translateY(-50%) scale(1); }
.tl-tip { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(20, 20, 24, 0.9);
  padding: 3px 8px; border-radius: 6px; font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
.player-loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.player-loader { grid-auto-flow: row; align-content: center; gap: 14px; }
.loader-hint { color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; text-shadow: 0 1px 4px #000; }
.player-hint { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 9; display: flex; align-items: center;
  gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: rgba(16, 17, 21, 0.92); color: var(--text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); max-width: calc(100% - 32px); flex-wrap: wrap; }
.player-loader .spinner { width: 54px; height: 54px; border-color: rgba(255, 255, 255, 0.15); border-top-color: var(--accent); }
.player-error { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; background: rgba(0, 0, 0, 0.7); }
.player-error .error-box { color: var(--text); }
.player.paused::after { content: ""; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/42px no-repeat;
  pointer-events: none; z-index: 2; }
.sub-layer { position: absolute; left: 6%; right: 6%; bottom: var(--sub-bottom, 9%); text-align: center; z-index: 4; pointer-events: none;
  transition: bottom 0.3s; }
.player:not(.idle) .sub-layer { bottom: max(19%, var(--sub-bottom, 9%)); }
.sub-line { display: inline; white-space: pre-line; line-height: 1.35; padding: 0.1em 0.4em; background: var(--sub-bg, rgba(0, 0, 0, 0.55));
  color: var(--sub-color, #fff); font-family: var(--sub-font, inherit);
  border-radius: 4px; text-shadow: var(--sub-shadow, 0 1px 2px #000); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.skip-btn { position: absolute; right: clamp(16px, 3vw, 36px); bottom: 130px; z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.6); background: rgba(15, 15, 18, 0.75);
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; backdrop-filter: blur(8px); animation: slide-in 0.35s ease-out; }
.skip-btn:hover { background: #fff; color: #000; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.next-card { position: absolute; right: clamp(16px, 3vw, 36px); bottom: 130px; z-index: 7; display: flex; gap: 14px; width: min(460px, calc(100% - 32px));
  background: rgba(18, 18, 22, 0.92); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 12px;
  backdrop-filter: blur(10px); animation: slide-in 0.35s ease-out; }
.next-card img { width: 150px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.next-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: #fff; }
.next-count { color: var(--accent); font-weight: 700; }
.next-card.end { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: min(560px, calc(100% - 32px));
  padding: 16px; animation: none; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.next-card.end img { width: 200px; }
.next-card.end .next-count { font-size: 15px; }
.player-menu { position: absolute; right: clamp(16px, 3vw, 36px); bottom: 96px; z-index: 9; display: flex; gap: 6px;
  background: rgba(18, 18, 22, 0.96); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 10px;
  max-height: 60vh; overflow: auto; color: #fff; }
.menu-col { min-width: 200px; display: flex; flex-direction: column; }
.menu-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.55); padding: 6px 12px; }
.menu-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; color: #fff; text-align: left;
  cursor: pointer; border-radius: 8px; }
.menu-opt span:first-child { flex: 1; }
.menu-opt:hover { background: rgba(255, 255, 255, 0.1); }
.menu-opt.on { color: var(--accent); }
.menu-opt .icon { fill: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  .topbar-right { margin-left: auto; gap: 8px; min-width: 0; max-width: 100%; }
  .topbar-right .search { flex: 1 1 auto; min-width: 0; }
  .search input.search-input { width: 100%; min-width: 60px; }
  .detail-inner { flex-direction: column; }
  .detail-poster { width: 150px; }
  .episode { flex-direction: column; gap: 10px; }
  .episode-thumb { width: 100%; }
  .filters { margin-left: 0; width: 100%; }
  .filters select { flex: 1; }
  .profile-row { flex-direction: column; }
  .time { display: none; }
  .ctl { width: 40px; height: 40px; }
  .player-menu { left: 12px; right: 12px; flex-direction: column; }
  .skip-btn, .next-card { bottom: 110px; }
  .next-card img { width: 110px; }
  .hero { min-height: 70vh; }
  :root { --topbar-h: 108px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- bibliothèques, identification ---------- */
.folder-path { font-family: ui-monospace, monospace; font-size: 13px; padding: 8px 10px; background: var(--bg); border-radius: 8px;
  margin-bottom: 8px; word-break: break-all; }
.folder-list { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.folder { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; }
.folder:hover { background: var(--surface-2); }
.paths { display: flex; flex-direction: column; gap: 8px; }
.path-row { display: flex; gap: 8px; align-items: center; }
.user-row code { display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12px; }
.user-row code.bad-path { background: color-mix(in srgb, var(--danger) 25%, transparent); }
.lib-icon { font-size: 26px; width: 40px; text-align: center; }
.panel.scan { margin-bottom: 16px; padding: 16px 20px; }
.scan details { margin-top: 8px; font-size: 14px; }
.scan ul { max-height: 200px; overflow: auto; margin: 6px 0; }
.bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.bar-fill { height: 100%; background: var(--accent); transition: width 0.4s; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--line); }
.admin-tools code { word-break: break-all; }
.grid-search { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; align-items: end; }
.grid-search .btn { margin-bottom: 14px; }
.identify-results { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.identify-hit { display: flex; gap: 12px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; cursor: pointer; }
.identify-hit:hover, .identify-hit.on { border-color: var(--accent); }
.identify-hit img, .identify-hit .noimg { width: 56px; height: 84px; object-fit: cover; border-radius: 6px; flex: none; }
.identify-hit p { margin: 4px 0 0; color: var(--muted); }
.menu-info { max-width: 220px; font-size: 12px; color: rgba(255, 255, 255, 0.65); padding: 8px 12px 4px; margin: 6px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1); }
.empty .btn { margin-top: 12px; }
@media (max-width: 760px) { .grid-search { grid-template-columns: 1fr; } .path-row { flex-wrap: wrap; } }
img.broken { visibility: hidden; }
/* ---------- partages réseau ---------- */
.share-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.share-pick { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.share-pick:hover, .share-pick.on { border-color: var(--accent); }
.advanced { margin: 4px 0 12px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.tag.ok { background: color-mix(in srgb, var(--ok) 25%, transparent); margin-left: 8px; }
.tag.bad { background: color-mix(in srgb, var(--danger) 30%, transparent); margin-left: 8px; }
.panel.warn { border-color: color-mix(in srgb, var(--accent) 50%, transparent); margin-bottom: 16px; }
.panel.warn ol { padding-left: 20px; line-height: 1.6; }
.panel.warn code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.subs-wait { position: absolute; inset: 0; display: grid; place-items: center; z-index: 7; padding-top: 140px; pointer-events: none; }
.subs-wait-box { pointer-events: auto; width: min(360px, calc(100% - 32px)); text-align: center; background: rgba(18, 18, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 16px 18px; color: #fff; }
.subs-wait-box p { color: rgba(255, 255, 255, 0.7); margin: 4px 0 12px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.copy-row input { font-family: ui-monospace, monospace; font-size: 12px; }
h3.sub { font-size: 15px; margin: 22px 0 10px; }
/* ---------- aperçus et chapitres ---------- */
.tl-chapters { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.tl-chapter { position: absolute; top: -1px; bottom: -1px; width: 3px; margin-left: -1px; background: rgba(0, 0, 0, 0.75); }
.tl-tip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; text-align: center; max-width: 280px; }
.tl-preview-img { border-radius: 6px; background-color: #000; background-repeat: no-repeat; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.tl-preview-chapter { font-size: 12px; font-weight: 600; color: #fff; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-preview-chapter:empty { display: none; }
.tl-preview-time { font-size: 13px; }
.chapters-col { min-width: 260px; }
/* ---------- menu ⋯ et choix des pistes ---------- */
.more-wrap { position: relative; display: inline-block; }
.btn.icon-only { padding: 10px; }
.more-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }
.more-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; cursor: pointer;
  border-radius: 8px; font-size: 14px; }
.more-item:hover { background: var(--surface-2); }
.more-item.danger { color: var(--danger); }
.more-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.more-heading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 6px 12px 2px; }
.track-chooser { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: -6px 0 18px; }
.track-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.track-field select { width: auto; min-width: 220px; max-width: 360px; padding: 8px 10px; background: var(--surface); }
.file-facts code { word-break: break-all; font-size: 12px; }
/* ---------- profils ---------- */
.profiles-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: 32px 16px; background: var(--bg); }
.profiles-page .auth-brand { align-items: center; }
.profiles-title { font: 800 clamp(30px, 5vw, 48px) var(--display); letter-spacing: -0.02em; }
.profiles-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; max-width: 900px; }
.profile-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0;
  cursor: pointer; padding: 8px; border-radius: 16px; color: var(--muted); transition: transform 0.15s, color 0.15s; }
.profile-tile .avatar { border: 3px solid transparent; transition: border-color 0.15s; font-size: 44px !important; }
.profile-tile:hover, .profile-tile:focus-visible { color: var(--text); transform: translateY(-3px); }
.profile-tile:hover .avatar, .profile-tile.current .avatar { border-color: var(--text); }
.profile-name { font-weight: 600; font-size: 16px; }
.profile-lock { position: absolute; top: 6px; right: 6px; font-size: 18px; }
.profile-kid { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.pin-pad { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 16px; }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pin-dots { display: flex; gap: 12px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dot.on { background: var(--accent); border-color: var(--accent); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.pin-key { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; font-weight: 600; cursor: pointer; }
.pin-key:hover { background: var(--bg); }
.form-sub { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 6px; }
/* ---------- collections, playlists, à regarder ---------- */
.view-tabs { margin: -8px 0 22px; }
.btn.icon-only.on { color: var(--accent); }
.card-img.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); }
.card-img.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 45vh; overflow: auto; margin-bottom: 14px; }
.pick-item { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.pick-item:hover { border-color: var(--accent); }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.checks.single { grid-template-columns: 1fr; }
.trailer-box { position: relative; aspect-ratio: 16 / 9; width: min(860px, 85vw); }
.trailer-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
.modal:has(.trailer-box) { max-width: 920px; }
textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; }

/* ------------------------------------------------------------ Découvrir */
.discover-search { display: flex; align-items: center; gap: 8px; margin-left: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 99px; padding: 0 14px; min-width: min(360px, 100%); }
.discover-search .icon { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.discover-search input[type="search"] { border: 0; background: transparent; padding: 10px 0; outline: none; width: 100%;
  border-radius: 0; box-shadow: none; }
.discover-note { margin: -8px 0 18px; }
.provider-title { display: inline-flex; align-items: center; gap: 10px; }
.provider-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.provider-logo.big { width: 40px; height: 40px; border-radius: 10px; }
.browse-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.browse-title { display: flex; align-items: center; gap: 12px; font-size: 24px; }
.filters-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.filters-row .tabs { margin-bottom: 0; }
.filters-row select { width: auto; }
.filters-row + .grid { margin-top: 18px; }
.center-row { display: flex; justify-content: center; padding: 24px 0; }
.dbadge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.72); color: #fff;
  backdrop-filter: blur(4px); }
.dbadge .icon { width: 13px; height: 13px; fill: currentColor; }
.dbadge.available { background: var(--ok); color: #06210f; }
.dbadge.partial, .dbadge.processing { background: #4c9aff; color: #04152b; }
.dbadge.pending { background: var(--accent); color: var(--ink-on-accent); }
.dbadge.blocked { background: var(--danger); }
.dbadge.wished { left: auto; right: 8px; padding: 4px; }
.request-status { display: inline-block; margin-top: 16px; padding: 6px 12px; border-radius: 10px; font-weight: 600;
  font-size: 14px; background: var(--surface-2); }
.request-status.pending { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.request-status.processing, .request-status.partial { background: color-mix(in srgb, #4c9aff 22%, transparent); }
.streams { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.stream img { width: 36px; height: 36px; border-radius: 9px; display: block; }
.check-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2);
  cursor: pointer; }
.check-row input { width: auto; }
.steps { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }
.steps ul { margin: 6px 0; padding-left: 20px; }
.steps code { background: var(--surface); padding: 1px 6px; border-radius: 6px; }
@media (max-width: 700px) {
  .discover-search { margin-left: 0; width: 100%; }
}
/* rendu ASS (libass) : canevas au-dessus de la vidéo, sous les commandes */
.player .JASSUB { position: absolute !important; inset: 0; pointer-events: none; z-index: 2; }
.sub-top { top: 6%; bottom: auto !important; }
.player:not(.idle) .sub-top { top: 14%; }
.sub-layer > div + div { margin-top: 0.25em; }
.player .pgs-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; z-index: 2; }
.subs-pending { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); z-index: 4; padding: 6px 14px;
  border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: rgba(255, 255, 255, 0.85); font-size: 0.9rem; pointer-events: none; }

/* ---------- chapitres en vignettes (lecteur et fiche) ---------- */
.chapter-strip { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.chapter-card { flex: none; width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0;
  background: none; color: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; font: inherit; }
.chapter-img { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden;
  background: #000 linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)); margin-bottom: 8px;
  outline: 2px solid transparent; outline-offset: 0; transition: outline-color 0.15s, transform 0.15s; }
.chapter-img img { width: 100%; height: 100%; object-fit: cover; }
.chapter-card.on .chapter-img { outline-color: var(--accent); }
.chapter-card:hover .chapter-img, .chapter-card:focus-visible .chapter-img { outline-color: rgba(255, 255, 255, 0.85); }
.chapter-card:focus-visible { outline: none; }
.chapter-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter-panel { position: absolute; left: 0; right: 0; bottom: 92px; z-index: 12; padding: 16px clamp(16px, 3vw, 36px) 8px;
  background: rgba(44, 45, 50, 0.97); color: #fff; animation: rise 0.2s ease-out; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35); }
.chapter-panel .chapter-time { color: rgba(255, 255, 255, 0.55); }
.chapter-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.chapter-panel-head h3 { font-size: 17px; }
.chapter-panel-head .muted { color: rgba(255, 255, 255, 0.55); }
.chapter-panel .icon-btn { color: #fff; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.block .chapter-strip { gap: 18px; }
.block .chapter-card { width: 220px; }
@media (max-width: 760px) {
  .chapter-card { width: 150px; }
  .chapter-strip { gap: 14px; }
  .chapter-panel { bottom: 84px; }
}

/* ---------- regarder ensemble ---------- */
.ctl { position: relative; }
.ctl.on { color: var(--accent); }
.ctl-badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: var(--ink-on-accent); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.group-banner { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 8; padding: 8px 16px; border-radius: 99px;
  background: rgba(16, 17, 21, 0.9); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }
.group-col { min-width: 280px; }
.group-members { display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 8px; }
.group-member { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.group-member .tag { margin-left: 8px; }
.menu-info { font-size: 13px; color: rgba(255, 255, 255, 0.65); padding: 2px 12px 8px; margin: 0; max-width: 300px; }
.group-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; }
.group-card img, .group-card .noimg { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.group-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.group-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); white-space: nowrap; }
.group-pill .icon { width: 16px; height: 16px; }

/* ---------- TV en direct ---------- */
.live-tabs { margin-bottom: 0; }
.live-tabs .tab { display: inline-flex; align-items: center; gap: 8px; }
.live-tabs .icon { width: 18px; height: 18px; }
.live-search { width: 220px; }
.live-body { margin-top: 18px; }
.ch-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.ch-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); transition: border-color 0.15s, transform 0.15s; position: relative; }
.ch-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-1px); }
.ch-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-num { display: inline-block; min-width: 26px; margin-right: 6px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.ch-now { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-card .progress { position: static; height: 3px; border-radius: 3px; background: var(--surface-2); }
.ch-logo { flex: none; display: grid; place-items: center; border-radius: 8px; background: #fff; overflow: hidden; }
:root:not([data-theme="light"]) .ch-logo { background: #23252d; }
.ch-logo.m { width: 64px; height: 44px; }
.ch-logo.s { width: 46px; height: 32px; border-radius: 6px; }
.ch-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ch-initials { font-weight: 800; font-size: 14px; color: var(--muted); letter-spacing: 0.04em; }
.icon-btn.fav { color: var(--muted); }
.icon-btn.fav.on { color: var(--accent); }
.guide-scroll { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  position: relative; }
.guide-grid { position: relative; width: calc(var(--guide-w) + 200px); }
.guide-row { display: flex; border-bottom: 1px solid var(--line); min-height: 58px; }
.guide-head { position: sticky; top: 0; z-index: 3; min-height: 34px; background: var(--surface-2); }
.guide-ch { position: sticky; left: 0; z-index: 2; width: 200px; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface); border-right: 1px solid var(--line); min-width: 0; }
.guide-head .guide-ch { background: var(--surface-2); text-transform: capitalize; }
.guide-ch-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-track { position: relative; flex: none; }
.guide-ruler { position: relative; height: 34px; }
.guide-tick { position: absolute; top: 8px; font-size: 12px; color: var(--muted); padding-left: 6px; border-left: 1px solid var(--line);
  height: 26px; font-variant-numeric: tabular-nums; }
.guide-now { position: absolute; top: 0; bottom: -100vh; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }
.guide-prog { position: absolute; top: 5px; bottom: 5px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 4px 10px; border-radius: 6px; border: 0; background: var(--surface-2); color: inherit; text-align: left; cursor: pointer;
  overflow: clip; font: inherit; min-width: 0; align-items: flex-start; }
.guide-prog > span { position: sticky; left: 210px; max-width: 100%; }
.guide-prog:hover { filter: brightness(1.2); }
.guide-prog.live { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.guide-prog.past { opacity: 0.55; }
.guide-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.guide-empty { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.live-player .controls { padding-top: 80px; }
.live-now { margin-bottom: 8px; }
.live-prog { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: rgba(255, 255, 255, 0.85); }
.live-prog .progress { position: static; width: min(320px, 40vw); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); }
.live-prog .muted { color: rgba(255, 255, 255, 0.6); }
.live-tag { margin-left: 10px; padding: 2px 8px; border-radius: 4px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; }
.live-side { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 90vw); z-index: 9; display: flex; flex-direction: column;
  background: rgba(18, 18, 22, 0.97); border-left: 1px solid rgba(255, 255, 255, 0.1); animation: slide-in 0.2s ease-out; }
.live-side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.live-side-head .icon-btn { color: #fff; }
.live-side-list { overflow: auto; padding: 0 8px 16px; }
.live-side-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.live-side-item:hover { background: rgba(255, 255, 255, 0.08); }
.live-side-item.on { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.live-side-item .grow { display: flex; flex-direction: column; min-width: 0; }
.live-side-item strong, .live-side-item .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-side-item .muted { color: rgba(255, 255, 255, 0.6); }
.live-side .ch-logo { background: #23252d; }
@media (max-width: 760px) {
  .live-search { width: 100%; }
  .guide-ch { width: 120px; }
  .guide-ch .ch-logo { display: none; }
  .guide-grid { width: calc(var(--guide-w) + 120px); }
  .guide-prog > span { left: 130px; }
}

/* ---------- tâches planifiées ---------- */
.task-group { margin-bottom: 22px; }
.task-group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 10px; }
.task-row { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 8px; }
.task-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.task-icon .icon { width: 20px; height: 20px; }
.task-row .task-desc { margin: 2px 0 6px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.task-meta .bad { color: var(--danger); }
.task-meta .ok { color: var(--ok); }
.task-actions { display: flex; gap: 6px; flex: none; align-items: center; }
.task-row .bar { margin-top: 8px; }
.task-running { font-size: 13px; color: var(--text); margin-top: 6px; }
.sched-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.sched-row .field { flex: 1; min-width: 140px; }
@media (max-width: 760px) {
  .task-row { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-end; }
}
.scroll-list { max-height: 50vh; overflow: auto; margin-top: 10px; padding-right: 6px; }
.toggle-hint { margin: -4px 0 6px 52px; }
.task-meta .icon { width: 14px; height: 14px; vertical-align: -2px; }
.admin-body > .panel + .panel, .admin-body > section.panel + section.panel { margin-top: 16px; }

/* ---------- lecteur réduit (continue pendant la navigation) ---------- */
.mini-bar { display: none; }
.player.mini { inset: auto 20px 20px auto; width: min(400px, calc(100vw - 32px)); height: auto; aspect-ratio: 16 / 9;
  border-radius: 14px; z-index: 150; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer; animation: mini-in 0.25s cubic-bezier(.2, .8, .2, 1); }
@keyframes mini-in { from { transform: translateY(16px) scale(0.96); opacity: 0; } }
.player.mini .player-top, .player.mini .controls, .player.mini .player-menu, .player.mini .chapter-panel,
.player.mini .skip-btn, .player.mini .next-card:not(.end), .player.mini .subs-pending, .player.mini .subs-wait,
.player.mini .player-hint, .player.mini .group-banner { display: none !important; }
.player.mini::after { display: none; }
.player.mini .sub-layer { font-size: 13px !important; bottom: 6%; }
.player.mini .mini-bar { display: flex; position: absolute; inset: 0; z-index: 10; align-items: center; justify-content: center;
  gap: 14px; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.2s; }
.player.mini:hover .mini-bar, .player.mini:focus-within .mini-bar { opacity: 1; }
.player.mini .mini-bar .ctl { background: rgba(0, 0, 0, 0.5); }
.player.mini .next-card.end { width: calc(100% - 16px); padding: 8px; gap: 8px; }
.player.mini .next-card.end img { display: none; }
@media (hover: none) {
  .player.mini .mini-bar { opacity: 1; background: none; align-items: flex-end; padding-bottom: 6px; }
}
@media (max-width: 760px) { .player.mini { inset: auto 12px 12px auto; width: min(300px, calc(100vw - 24px)); } }

/* ---------- « marquer comme vu » sur les cartes de Reprendre et à suivre ---------- */
.card-slot { position: relative; min-width: 0; scroll-snap-align: start; transition: opacity 0.25s, transform 0.25s; }
.card-slot.leaving { opacity: 0.25; transform: scale(0.96); pointer-events: none; }
.card-watch { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; opacity: 0;
  backdrop-filter: blur(6px); transition: opacity 0.2s, background 0.2s, transform 0.2s; }
.card-watch .icon { width: 18px; height: 18px; fill: currentColor; }
.card-slot:hover .card-watch, .card-watch:focus-visible { opacity: 1; }
.card-slot:hover .card-watch { transform: translateY(-4px); }
.card-watch:hover { background: var(--accent); color: var(--ink-on-accent); }
@media (hover: none) { .card-watch { opacity: 0.9; } }
.toast-action { pointer-events: auto; margin-left: 14px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Réglages : ordre de l'accueil et de la barre du haut ---------- */
.layout-list { list-style: none; margin: 4px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layout-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-radius: 10px;
  background: var(--surface-2); transition: opacity 0.2s, background 0.2s; }
.layout-item.off .layout-label { opacity: 0.45; }
.layout-item.dragging { opacity: 0.4; }
.layout-item .toggle { margin: 0; }
.layout-grip { cursor: grab; color: var(--muted); letter-spacing: -3px; padding: 0 6px; user-select: none; }
.layout-label { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.layout-label .muted { font-weight: 400; }
.layout-item .icon-btn[disabled] { opacity: 0.25; cursor: default; }

/* ---------- animations (désactivées si le système demande moins de mouvement) ---------- */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes hero-zoom { from { transform: scale(1.06); } }

/* changement de page : le contenu monte doucement */
.content > :not(.hero):not(.detail) { animation: fade-up 0.45s var(--ease-out) backwards; }
.content > :nth-child(2) { animation-delay: 0.04s; }
.content > :nth-child(3) { animation-delay: 0.08s; }
.content > :nth-child(4) { animation-delay: 0.12s; }
.content > :nth-child(n+5) { animation-delay: 0.16s; }

/* grande affiche de l'accueil et fiche : fond qui se pose, texte en cascade */
.hero { animation: fade-in 0.6s ease-out backwards; }
.hero-body > * { animation: fade-up 0.6s var(--ease-out) backwards; }
.hero-body > :nth-child(2) { animation-delay: 0.06s; }
.hero-body > :nth-child(3) { animation-delay: 0.12s; }
.hero-body > :nth-child(4) { animation-delay: 0.18s; }
.hero-body > :nth-child(n+5) { animation-delay: 0.24s; }
.detail-backdrop { animation: fade-in 0.7s ease-out backwards; }
.detail-poster { animation: fade-up 0.5s var(--ease-out) backwards; }
.detail-inner > :not(.detail-poster) { animation: fade-up 0.5s var(--ease-out) 0.08s backwards; }

/* cartes : arrivée en cascade dans les rangées et les grilles */
.row-track > *, .grid > * { animation: fade-up 0.4s var(--ease-out) backwards; }
.row-track > :nth-child(2), .grid > :nth-child(2) { animation-delay: 0.03s; }
.row-track > :nth-child(3), .grid > :nth-child(3) { animation-delay: 0.06s; }
.row-track > :nth-child(4), .grid > :nth-child(4) { animation-delay: 0.09s; }
.row-track > :nth-child(5), .grid > :nth-child(5) { animation-delay: 0.12s; }
.row-track > :nth-child(6), .grid > :nth-child(6) { animation-delay: 0.15s; }
.row-track > :nth-child(7), .grid > :nth-child(7) { animation-delay: 0.18s; }
.row-track > :nth-child(n+8), .grid > :nth-child(n+8) { animation-delay: 0.21s; }

/* images : fondu à l'arrivée plutôt qu'un affichage brutal ligne par ligne */
img.fade { opacity: 0; transition: opacity 0.4s ease-out; }
img.fade.in { opacity: 1; }

/* menus, fenêtres */
.user-menu:not([hidden]), .more-list:not([hidden]) { animation: pop-in 0.16s var(--ease-out); transform-origin: top right; }
.modal-overlay { animation: fade-in 0.18s ease-out; }
.modal { animation: modal-in 0.26s var(--ease-out); }
.player-menu:not([hidden]) { animation: pop-in 0.16s var(--ease-out); }

/* barre du haut : soulignement du lien actif qui se déploie */
.nav-link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.25s var(--ease-out); }
.nav-link:hover::after { transform: scaleX(0.4); opacity: 0.6; }
.nav-link.active::after { transform: scaleX(1); opacity: 1; animation: grow-x 0.35s var(--ease-out); }
@keyframes grow-x { from { transform: scaleX(0); } }

/* boutons : léger enfoncement au clic */
.btn, .ctl, .icon-btn { transition: transform 0.12s ease-out, background 0.15s, color 0.15s, border-color 0.15s, filter 0.15s; }
.btn:active, .ctl:active, .icon-btn:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  img.fade { opacity: 1; transition: none; }
}

/* ---------- Regarder ensemble : bouton de création, groupe en cours, salon ---------- */
.group-new { position: relative; color: var(--text); }
.group-new .icon { width: 22px; height: 22px; fill: currentColor; }
.group-new .plus { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; display: grid;
  place-items: center; background: var(--accent); color: var(--ink-on-accent); font: 700 12px/1 var(--display, inherit); }
.group-pill.mine { background: var(--accent); color: var(--ink-on-accent); }
.group-pill.mine .icon { fill: currentColor; }
.group-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.25); font-size: 11px; }
.together-slot:empty { display: none; }
.lobby { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.lobby-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 13px; }
.lobby-kicker .icon { width: 18px; height: 18px; fill: currentColor; }
.lobby-title { font: 800 clamp(34px, 5vw, 56px)/1.05 var(--display); letter-spacing: -0.03em; margin: 10px 0 12px; }
.lobby .muted { max-width: 52ch; margin: 0 auto; }
.lobby-members { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 36px 0; }
.lobby-member { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; transition: opacity 0.3s; }
.lobby-member.away { opacity: 0.45; }
.lobby-member .chip { font-size: 11px; }
.lobby-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 760px) { .group-new { display: none; } }

/* ---------- application installée (web app) ---------- */
.topbar-back { display: none; color: var(--text); flex: none; }
.user-menu .install-app { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; }
.user-menu .install-app[hidden] { display: none; }
.user-menu .install-app .icon { width: 18px; height: 18px; fill: currentColor; }
.install-steps ol { padding-left: 20px; line-height: 1.9; }
.install-steps .icon { width: 18px; height: 18px; vertical-align: -3px; fill: var(--accent); }
@media (display-mode: standalone) {
  .topbar-back:not([hidden]) { display: inline-grid; margin-right: -16px; }
  /* iPhone : la barre d'état est par-dessus l'application (black-translucent) */
  :root { --safe-top: env(safe-area-inset-top, 0px); }
  .player-top { padding-top: env(safe-area-inset-top); }
  .controls { padding-bottom: env(safe-area-inset-bottom); }
  body { overscroll-behavior-y: none; } /* pas de « tirer pour rafraîchir » qui recharge l'application */
}

/* ---------- téléchargements (regarder hors ligne) ---------- */
.dl-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.dl-row { display: flex; align-items: center; gap: 16px; padding: 10px; border-radius: 12px; background: var(--surface); }
.dl-thumb { position: relative; flex: none; width: 160px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dl-thumb:hover .play-hover { opacity: 1; }
.dl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dl-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.dl-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; max-width: 320px; }
.dl-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }
.dl-progress.preparing span { opacity: 0.55; }
.dl-progress.error span { background: var(--danger); }
.offline-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin: 6px 0 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-weight: 600; }
.offline-banner .icon { width: 22px; height: 22px; fill: var(--accent); flex: none; }
.offline-bar .logo { display: flex; align-items: center; gap: 10px; font: 800 22px var(--display); }
.detail-actions .btn.on .icon { fill: var(--accent); }
@media (max-width: 760px) {
  .dl-thumb { width: 112px; }
  .dl-row { gap: 10px; align-items: flex-start; }
  .dl-actions .btn { display: none; } /* la vignette suffit pour lancer */
}

.dl-room { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.dl-room:empty { display: none; }
.dl-room p { margin: 0; flex: 1; min-width: 240px; color: var(--muted); }

/* ---------- télécommande, clavier, manette : on voit toujours où l'on est ---------- */
.card:focus-visible .card-img, html.remote .card:focus .card-img, .dl-thumb:focus-visible, .episode-thumb:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px; }
html.remote :focus { outline: 3px solid var(--accent); outline-offset: 3px; }
html.remote .card:focus { outline: none; }
html.remote .card:focus .card-img { transform: translateY(-4px) scale(1.04); }
.card-slot:focus-within .card-watch { opacity: 1; }
html.remote .player .ctl:focus { background: rgba(255, 255, 255, 0.2); outline-offset: 0; }

/* ---- mise à jour : indicateur (administrateurs), suivi, redémarrage */
.update-btn { position: relative; color: var(--accent); display: inline-grid; place-items: center; }
.update-btn .icon { width: 24px; height: 24px; fill: currentColor; }
.update-btn::after { content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg); animation: update-pulse 2s ease-in-out infinite; }
@keyframes update-pulse { 50% { transform: scale(1.5); opacity: 0.5; } }
.update-overlay { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); }
.update-box { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; display: grid; gap: 12px; }
.update-box h2 { margin: 0; }
.update-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.update-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.6s var(--ease-out, ease-out); }
.update-overlay.failed .update-bar-fill { background: var(--bad, #e5484d); }
.update-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.update-step { margin: 0; }
.update-pct { font-variant-numeric: tabular-nums; color: var(--muted); }
.update-log pre { max-height: 220px; overflow: auto; margin: 8px 0 0; }
.restart-box { display: grid; justify-items: center; gap: 10px; text-align: center; }
.restart-box h2 { margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .update-btn::after { animation: none; } }
.update-box .modal-actions:empty { display: none; }

/* ---- Paramètres : menu groupé + une page par sujet */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; max-width: 1180px; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + var(--safe-top) + 8px); display: grid; gap: 18px;
  max-height: calc(100vh - var(--topbar-h) - var(--safe-top) - 24px); overflow-y: auto; padding: 2px 4px 16px 2px; scrollbar-width: thin; }
.settings-search { width: 100%; }
.settings-group { display: grid; gap: 2px; }
.settings-group[hidden] { display: none; }
.settings-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  padding: 0 12px 6px; }
.settings-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text);
  font-weight: 500; transition: background 0.15s; }
.settings-link[hidden] { display: none; }
.settings-link .icon { width: 20px; height: 20px; flex: none; fill: var(--muted); }
.settings-link:hover { background: var(--surface-2); }
.settings-link.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.settings-link.active .icon { fill: var(--accent); }
.settings-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings-content { min-width: 0; max-width: 900px; }
.settings-head { margin-bottom: 18px; }
.settings-head h2 { font-size: 26px; margin: 0 0 4px; }
.settings-head p { margin: 0; }
.settings-body > * + * { margin-top: 16px; }
.settings-body > .panel h2 { font-size: 17px; }
.settings-back { display: none; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.settings-back .icon { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; gap: 0; }
  .settings-nav { position: static; max-height: none; overflow: visible; padding: 0; }
  .settings-link { padding: 13px 12px; background: var(--surface); border-radius: 0; border-bottom: 1px solid var(--line); }
  .settings-group .settings-link:first-of-type { border-radius: 12px 12px 0 0; }
  .settings-group .settings-link:last-of-type { border-radius: 0 0 12px 12px; border-bottom: 0; }
  .settings-group .settings-link:first-of-type:last-of-type { border-radius: 12px; }
  .settings-link::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 20px; line-height: 1; }
  .settings-link.active { box-shadow: none; }
  /* téléphone : d'abord le menu, puis la page choisie (avec un lien de retour) */
  .settings-page.no-section .settings-content { display: none; }
  .settings-page:not(.no-section) .settings-nav, .settings-page:not(.no-section) > .page-head { display: none; }
  .settings-back { display: inline-flex; }
  .settings-head h2 { font-size: 22px; }
}
/* paramètres : le menu reste en place, seule la page choisie arrive en douceur */
.content > .settings-page { animation: none; }
.settings-content { animation: fade-up 0.3s var(--ease-out) backwards; }
@media (prefers-reduced-motion: reduce) { .settings-content { animation: none; } }
.settings-badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--accent); color: var(--ink-on-accent, #1c0f00); }
@media (max-width: 860px) { .settings-badge + * { margin-left: 8px; } .settings-link:has(.settings-badge)::after { margin-left: 8px; } }
.menu-version { padding: 8px 14px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
.sec-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.sec-list .sec-ok strong { color: var(--ok); }
.sec-list .sec-warn strong { color: var(--accent); }

/* aperçu du style des sous-titres (Paramètres → Lecture) */
.sub-preview { position: relative; height: 150px; border-radius: 10px; overflow: hidden; margin-bottom: 16px;
  background: linear-gradient(160deg, #2c3e50 0%, #7f8c8d 45%, #d7c49e 100%); }
.sub-preview .sub-layer { bottom: var(--sub-bottom, 9%); font-size: 18px; }

/* anti-spoiler : vignettes floutées et résumés masqués pour les épisodes non vus (clic pour afficher) */
.no-spoilers .spoiler-img { overflow: hidden; }
.no-spoilers .spoiler-img img { filter: blur(16px) brightness(0.75); transform: scale(1.12); }
.no-spoilers .spoiler:not(.revealed) { filter: blur(6px); cursor: pointer; user-select: none; transition: filter 0.2s; }
.no-spoilers .spoiler:not(.revealed):hover { filter: blur(5px); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px; }
.preset { padding: 0; border: 3px solid transparent; border-radius: 50%; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: none;
  transition: transform 0.15s; }
.preset svg { width: 100%; height: 100%; display: block; }
.preset:hover { transform: scale(1.06); }
.preset.on, .preset:focus-visible { border-color: var(--accent); outline: none; }
.modal:has(.avatar-picker) { max-width: 820px; }
.avatar-picker { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start; }
.avatar-side { display: grid; justify-items: center; gap: 8px; }
/* 12 fonds : 4 colonnes × 3 lignes, dans la largeur de la colonne */
.avatar-side .swatches { display: grid; grid-template-columns: repeat(4, 30px); gap: 10px; justify-content: center; }
.avatar-preview { width: 160px; height: 160px; border-radius: 50%; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.avatar-preview svg { display: block; }
.avatar-preview-label { font-weight: 700; }
/* catégories sur une seule ligne ; sur un écran étroit, elles défilent horizontalement */
.avatar-tabs { margin-bottom: 14px; flex-wrap: nowrap; }
.avatar-tabs .tab { flex: none; padding: 8px 14px; white-space: nowrap; }
.avatar-main { min-width: 0; }
@media (max-width: 640px) { .avatar-picker { grid-template-columns: 1fr; } .avatar-preview { width: 120px; height: 120px; } .avatar-preview svg { width: 120px; height: 120px; }
  .avatar-tabs { flex-wrap: wrap; justify-content: center; } .avatar-tabs .tab { padding: 6px 12px; font-size: 14px; } }
/* réglage de l'appareil : animations réduites */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }

/* interface enfant : grandes vignettes, textes plus gros, barre du haut simplifiée */
html.kids .group-new, html.kids .together-slot { display: none; }
html.kids .card-title { font-size: 16px; }
html.kids .row-title { font-size: 24px; }
html.kids .nav-link { font-size: 17px; }
html.kids .card, html.kids .card-img { border-radius: 16px; }
html.kids .card:focus-visible, html.kids .card:hover { transform: scale(1.04); }

/* notifications de nouveaux épisodes */
.notif-btn { position: relative; color: var(--text); }
.notif-btn .icon { width: 24px; height: 24px; fill: currentColor; }
.notif-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--ink-on-accent, #1c0f00); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.notif-badge[hidden] { display: none; }
.notif-menu { width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; }
.notif-head { padding: 12px 16px 8px; font-weight: 700; }
.notif-menu .notif-item { display: flex; gap: 12px; align-items: center; padding: 8px 16px; }
.notif-item img, .notif-item .noimg { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2); }
.notif-item.unread strong::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.notif-text { display: grid; gap: 2px; min-width: 0; }
.notif-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-empty, .notif-foot { padding: 8px 16px 12px; margin: 0; }

/* bilan de visionnage (Historique) */
.recap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 24px; }
.recap-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.recap-head h2 { margin: 0 auto 0 0; font-size: 20px; }
.recap-head select { width: auto; }
.recap-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 120px; align-items: end; margin: 18px 0 8px; }
.recap-month { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; gap: 4px; }
.recap-month span { font-size: 11px; color: var(--muted); }
.recap-bar { align-self: end; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.recap-genres { align-items: center; margin: 12px 0; }
.recap-top { margin-top: 8px; }

/* double authentification */
.qr-box { display: grid; place-items: center; padding: 8px 0; }
.qr-box .qr { border-radius: 8px; background: #fff; }
.secret-key { font-size: 15px; letter-spacing: 0.08em; user-select: all; }
.recovery-codes { columns: 2; padding-left: 1.4em; margin: 10px 0; font-size: 15px; }
.recovery-codes code { user-select: all; letter-spacing: 0.05em; }
.twofa-admin { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: 8px; background: color-mix(in srgb, var(--ok) 12%, transparent); }
/* À propos, attribution des données (TMDB, JustWatch) */
.data-credit { margin-top: 32px; }
.about ul { margin: 6px 0 12px; padding-left: 20px; line-height: 1.7; }
.about .sub { margin-top: 18px; }

/* Serveurs liés : invitation à copier */
.invite-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; resize: none; }
.peer-row .grow { min-width: 0; }
.peer-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .peer-row { flex-wrap: wrap; }
  .peer-row .grow { flex: 1 1 calc(100% - 60px); }
  .peer-actions { width: 100%; justify-content: flex-end; }
}
.peer-libs { display: grid; gap: 8px; margin-top: 10px; }
.peer-lib { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.peer-lib select { max-width: 260px; }
@media (max-width: 640px) { .peer-lib { flex-wrap: wrap; } .peer-lib select { max-width: none; width: 100%; } }
/* bibliothèque d'un serveur lié : simple badge */
.server-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  color: var(--muted); border: 1px solid var(--line); }
.server-badge svg { width: 13px; height: 13px; }
.account-pick input { width: 180px; margin-left: 6px; padding: 4px 8px; }
