/* Noxa — 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-theme="midnight"] {
  --bg: #0a0f1c; --surface: #111a2e; --surface-2: #19243f; --line: rgba(160, 190, 255, 0.11);
  --text: #eef2fb; --muted: #9aa6c0;
}
:root[data-theme="sepia"] {
  --bg: #f1e7d6; --surface: #fbf5ea; --surface-2: #e7dac3; --line: rgba(70, 45, 10, 0.13);
  --text: #3b2f22; --muted: #7a6a55; --ink-on-accent: #1c0f00; color-scheme: light;
}
:root[data-theme="contrast"] {
  --bg: #000; --surface: #000; --surface-2: #1b1b1b; --line: rgba(255, 255, 255, 0.55);
  --text: #fff; --muted: #e6e6e6;
}
:root[data-theme="contrast"] .card-img, :root[data-theme="contrast"] .panel { outline: 1px solid var(--line); }
:root[data-theme="contrast"] a:focus-visible, :root[data-theme="contrast"] button:focus-visible { outline: 3px solid var(--accent); }
/* taille du texte et densité (réglages du profil) */
:root[data-text="s"] body { zoom: 0.92; }
:root[data-text="l"] body { zoom: 1.1; }
:root[data-text="xl"] body { zoom: 1.22; }
:root[data-density="compact"] .grid { gap: 14px 10px; }
:root[data-density="compact"] .row-track { gap: 9px; }
:root[data-density="compact"] .row { margin-bottom: 18px; }
:root[data-density="compact"] .block { margin: 22px 0; }
:root[data-density="comfy"] .grid { gap: 32px 24px; }
:root[data-density="comfy"] .row-track { gap: 22px; }
:root[data-density="comfy"] .row { margin-bottom: 44px; }
:root[data-density="comfy"] .block { margin: 46px 0; }
/* cartes : éléments affichés selon le profil */
html.cards-no-titles .card.poster .card-title, html.cards-no-titles .card.poster .card-sub { display: none; }
html.cards-no-progress .card .progress { display: none; }
html.cards-no-watched .badge.done { display: none; }
html.cards-no-quality .card-q, html.cards-no-new .card-new { display: none; }
html:not(.cards-rating) .card-rate { display: none; }
.card-flags { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 44px); }
.card-flags span { padding: 1px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 18px;
  background: rgba(0, 0, 0, 0.7); color: #fff; letter-spacing: .02em; }
.card-flags .card-new { background: var(--accent); color: var(--ink-on-accent); }
.card-flags .card-rate { color: #ffd166; }
: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; }
html.has-wallpaper body { background: transparent; }
html.has-wallpaper body::before { content: ''; position: fixed; inset: -24px; z-index: -1; pointer-events: none; filter: blur(8px);
  background: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 93%, transparent) 70%),
    var(--wallpaper) center / cover no-repeat; }
.wallpaper-preview { width: 240px; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-2) center / cover no-repeat;
  border: 1px solid var(--line); }
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="sepia"] .btn.ghost, :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="sepia"] .topbar:not(.scrolled), :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="sepia"] .search, :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; flex-wrap: wrap; align-items: center; }
.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; }
.chip-toggle { border: 1px solid transparent; color: inherit; cursor: pointer; font: inherit; font-size: 13px; }
.chip-toggle.on { background: var(--accent); color: var(--ink-on-accent); text-decoration: line-through; }
.chip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }
a.person { color: inherit; text-decoration: none; border-radius: var(--radius); padding: 4px; margin: -4px; }
a.person:hover strong, a.person:focus-visible strong, .person-link:hover { color: var(--accent); }
img.person-init { object-fit: cover; }
.person-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.person-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.person-head h1 { margin: 0 0 4px; }
.person-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; font-size: 36px; }
.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-recap { background: color-mix(in srgb, #fff 30%, 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; max-width: calc(100vw - 16px); 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-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.discover-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.chip-link { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; font-size: 14px; white-space: nowrap; }
.chip-link:hover, .chip-link:focus-visible { border-color: var(--accent); }
.chip-link.active { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); font-weight: 600; }
.dcard-ask { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--ink-on-accent); font-size: 22px; line-height: 1; font-weight: 600; cursor: pointer;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.dcard-ask[hidden] { display: none; }
.dcard:hover .dcard-ask, .dcard-ask:focus-visible { opacity: 1; }
.dcard-ask:hover { transform: scale(1.12); }
.dcard-ask:disabled { opacity: 0.5; cursor: progress; }
@media (hover: none) { .dcard-ask { opacity: 0.95; } }
.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"]):not([data-theme="sepia"]) .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-about { right: 48px; text-decoration: none; }
.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 { color: var(--text); flex: none; margin-right: -10px; }
.topbar-back[hidden] { display: 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) {
  /* 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; min-width: 0; max-height: calc(100dvh - 32px); overflow-y: auto; }
.update-box > * { min-width: 0; }  /* le journal déplié ne doit pas élargir l'encadré au-delà de l'écran */
@media (max-width: 520px) { .update-overlay { padding: 10px; } .update-box { padding: 18px; } }
.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: min(220px, 40dvh); overflow: auto; margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.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; }

/* ------------------------------------------------------------ photothèque */
.crumbs { margin: -6px 0 16px; color: var(--muted); font-size: 14px; }
.crumbs:empty { display: none; }
.crumbs a { color: var(--muted); }
.crumbs strong { color: var(--text); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px 16px; margin-bottom: 28px; }
.album-grid:empty { display: none; }
.album-card { color: inherit; text-decoration: none; min-width: 0; }
.album-cover { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.album-card:hover .album-cover img, .album-card:focus-visible .album-cover img { transform: scale(1.04); }
.album-title { margin-top: 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-month { font-size: 18px; margin: 24px 0 10px; text-transform: capitalize; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; }
.photo-tile { aspect-ratio: 1; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; overflow: hidden; border-radius: 4px; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 2px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
body.viewer-open { overflow: hidden; }
.photo-viewer { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; outline: none; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.viewer-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px;
  padding: calc(10px + var(--safe-top)) 16px 24px; background: linear-gradient(rgba(0,0,0,.7), transparent); color: #fff; z-index: 1; }
.viewer-bar .icon-btn { color: #fff; }
.viewer-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.viewer-nav svg { width: 30px; height: 30px; }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }
.viewer-nav[hidden] { display: none; }
.viewer-info { position: absolute; right: 16px; bottom: 16px; background: rgba(20,20,24,.9); color: #fff; padding: 12px 16px;
  border-radius: var(--radius); font-size: 14px; line-height: 1.6; }
@media (hover: none) { .viewer-nav { display: none; } }

/* ------------------------------------------------------------ filtres et affichage des bibliothèques */
.filter-panel { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 16px; margin: -6px 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-panel[hidden] { display: none; }
.filter { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.filter select { width: auto; min-width: 130px; }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--accent); color: var(--ink-on-accent); font-size: 11px; font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg-btn { border: 0; background: none; color: var(--muted); padding: 6px 10px; cursor: pointer; display: grid; place-items: center; }
.seg-btn svg { width: 18px; height: 18px; }
.seg-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.lib-list { display: grid; gap: 6px; }
.lib-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: var(--radius); color: inherit;
  text-decoration: none; background: var(--surface); }
.lib-row:hover, .lib-row:focus-visible { background: var(--surface-2); }
.lib-row-img { width: 40px; height: 60px; border-radius: 4px; overflow: hidden; background: var(--surface-2); flex: none; }
.lib-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-row-main { flex: 1; min-width: 0; }
.lib-row-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row-main .progress { margin-top: 6px; max-width: 240px; }
.lib-row-state { color: var(--ok); }
@media (max-width: 700px) { .filters { margin-left: 0; width: 100%; } }
.link-chip { color: inherit; text-decoration: none; }
.link-chip:hover, .link-chip:focus-visible { background: var(--accent); color: var(--ink-on-accent); }
.stars { display: inline-flex; align-items: center; gap: 0; padding: 0 4px; }
.star { border: 0; background: none; font-size: 22px; line-height: 1; padding: 4px 2px; color: var(--line); cursor: pointer;
  -webkit-text-stroke: 1px var(--muted); color: transparent; }
.star.on { color: var(--accent); -webkit-text-stroke: 0; }
.star.hover { color: color-mix(in srgb, var(--accent) 60%, transparent); -webkit-text-stroke: 0; }
.star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line);
  border-bottom-width: 2px; background: var(--surface-2); font: 600 13px var(--sans); text-align: center; }
.keys-help h3 { font-size: 15px; margin: 14px 0 8px; }
.keys-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin: 0; }
.keys-list dd { margin: 0; }
.keys-edit { display: grid; gap: 6px; margin: 10px 0; }
.keys-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius); background: var(--surface-2); }

/* ------------------------------------------------------------ télécommande */
.remote-list .tabs { margin-bottom: 16px; }
.remote-card { max-width: 520px; display: grid; gap: 16px; padding: 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); }
.remote-now { display: flex; gap: 14px; align-items: center; }
.remote-now img { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.remote-now strong { display: block; font-size: 18px; }
.remote-seek { width: 100%; accent-color: var(--accent); }
.remote-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; margin-top: -10px; }
.remote-buttons { display: flex; justify-content: center; align-items: center; gap: 18px; }
.remote-btn { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); display: grid; place-items: center; cursor: pointer; }
.remote-btn svg { width: 26px; height: 26px; }
.remote-btn.main { width: 76px; height: 76px; background: var(--accent); color: var(--ink-on-accent); border: 0; }
.remote-btn.main svg { width: 36px; height: 36px; }
.remote-row { display: flex; align-items: center; gap: 10px; }
.remote-row input[type=range] { flex: 1; accent-color: var(--accent); }
.remote-selects { display: flex; flex-wrap: wrap; gap: 12px; }
.tile-video, .tile-fav { position: absolute; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px;
  border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.tile-video { right: 6px; bottom: 6px; }
.tile-fav { left: 6px; top: 6px; color: var(--accent); }
.tile-video svg, .tile-fav svg { width: 14px; height: 14px; }
.photo-tile { position: relative; }
.viewer-stage { display: contents; }
.viewer-msg { color: #fff; text-align: center; display: grid; gap: 12px; justify-items: center; }
.photo-viewer .icon-btn.on { color: var(--accent); }
.share-list { display: grid; gap: 8px; margin-top: 12px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); }
.share-row code { word-break: break-all; }
.share-head { padding: 18px var(--gutter); }
.share-page { padding: 0 var(--gutter) 40px; }
.cast-layer { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.85); z-index: 5; }
.cast-layer[hidden] { display: none; }
.cast-box { display: grid; justify-items: center; gap: 14px; text-align: center; color: #fff; padding: 24px; }
.cast-box > svg { width: 56px; height: 56px; color: var(--accent); }
.cast-ctl { display: flex; gap: 12px; }

/* carte des photos (tuiles OpenStreetMap) */
.photo-map { position: relative; height: min(62vh, 560px); margin: 8px 0 24px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); touch-action: none; user-select: none; cursor: grab; border: 1px solid var(--line); }
.photo-map:active { cursor: grabbing; }
.photo-map > .empty, .photo-map > .spinner { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
.map-tiles, .map-marks { position: absolute; inset: 0; }
.map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
:root[data-theme="dark"] .map-tiles, :root[data-theme="oled"] .map-tiles { filter: brightness(.82) contrast(1.05) saturate(.85); }
.map-mark { position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px; padding: 0; border-radius: 50%;
  border: 3px solid #fff; background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); cursor: pointer; }
.map-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.map-mark span { position: absolute; top: -8px; right: -10px; min-width: 22px; padding: 1px 6px; border-radius: 11px;
  background: var(--accent); color: var(--ink-on-accent); font-size: 12px; font-weight: 700; line-height: 18px; }
.map-mark:hover { transform: translate(-50%, -50%) scale(1.08); z-index: 2; }
.map-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.map-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.map-credit { position: absolute; right: 0; bottom: 0; z-index: 3; padding: 2px 8px; font-size: 11px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border-top-left-radius: 6px; }
.map-credit a { text-decoration: underline; }
.map-place-head { margin: 0 0 12px; font-size: 18px; }

/* sauvegardes */
.backup-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.backup-row .bad { color: #ff6b6b; }

/* choix de langues (OpenSubtitles) et résultats de recherche */
button.chip { border: 1px solid var(--line); cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }
.os-results { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; margin-top: 10px; }
.os-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.os-row .os-info { flex: 1; min-width: 0; }
.os-row .os-release { font-size: 13px; overflow-wrap: anywhere; }
.os-badge { display: inline-block; padding: 0 6px; margin-right: 4px; border-radius: 4px; font-size: 11px; background: var(--line); }
.os-badge.good { background: color-mix(in srgb, #3dd68c 30%, transparent); }

/* alertes des administrateurs */
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-row { display: block; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, #ff6b6b 45%, transparent);
  background: color-mix(in srgb, #ff6b6b 10%, var(--surface)); }
.alert-row:hover { background: color-mix(in srgb, #ff6b6b 16%, var(--surface)); }
.alert-conf { margin-top: 12px; }
.alert-conf summary { cursor: pointer; color: var(--muted); }

/* code de liaison Trakt */
.trakt-code { font: 700 32px/1.2 var(--mono, monospace); letter-spacing: .2em; padding: 14px 18px; margin: 10px 0 16px;
  border-radius: 12px; background: var(--surface-2); display: inline-block; user-select: all; }

/* lecteur audio (livres audio) : barre en bas, qui reste pendant la navigation */
html.has-audio body { padding-bottom: 96px; }
.audio-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); }
.ab-main { display: flex; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; }
.ab-cover { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; }
.ab-text { flex: 1; min-width: 0; }
.ab-title, .ab-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-title { font-weight: 600; }
.ab-sub { font-size: 12px; }
.ab-controls, .ab-extra { display: flex; align-items: center; gap: 4px; }
.ab-btn { min-width: 36px; height: 36px; border-radius: 18px; border: 0; background: transparent; cursor: pointer; font-size: 13px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.ab-btn:hover { background: var(--surface-2); }
.ab-btn.on { color: var(--accent); }
.ab-play { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: var(--ink-on-accent); }
.ab-play:hover { background: var(--accent); filter: brightness(1.08); }
.ab-seek { display: flex; align-items: center; gap: 10px; max-width: 1200px; margin: 4px auto 0; }
.ab-range { flex: 1; accent-color: var(--accent); }
.ab-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-menu { position: absolute; right: 16px; bottom: 100%; width: min(360px, calc(100vw - 32px)); max-height: 50vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.ab-chapter { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; text-align: left; }
.ab-chapter:hover, .ab-chapter.on { background: var(--surface-2); }
.ab-chapter.on span:first-child { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .ab-extra .ab-speed ~ .ab-btn:not(:last-child) { display: none; }
  .ab-controls .ab-btn:not(.ab-play) { min-width: 32px; padding: 0 2px; }
}

/* livres audio */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.book-tile { display: block; min-width: 0; }
.book-cover { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover > span { display: grid; place-items: center; width: 100%; height: 100%; }
.book-cover > span svg { width: 38%; height: 38%; opacity: .4; }
.book-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .45); }
.book-progress div { height: 100%; background: var(--accent); }
.book-done { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--accent); color: var(--ink-on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.book-title { margin-top: 8px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-detail { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 24px; }
.book-cover.big { width: min(280px, 40vw); flex: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.book-info { flex: 1; min-width: 0; }
.book-author { font-size: 17px; margin: 4px 0; }
.book-summary { white-space: pre-line; color: var(--muted); max-width: 70ch; }
.chapter-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: ch; }
.chapter-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; text-align: left; }
.chapter-row:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .book-detail { flex-direction: column; }
  .book-cover.big { width: 60vw; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}

/* administration d'un serveur lié : sélecteur en haut des pages d'administration */
.server-pick { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.server-pick label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.server-pick select { flex: 1; min-width: 200px; max-width: 420px; }
.server-pick.remote { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.server-pick p { margin: 8px 0 0; }

/* sauvegardes : stockages externes et recopies */
.remote-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.remote-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.remote-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.remote-card .backup-list { margin-top: 10px; }
.copy-status { margin: 10px 0 0; padding-left: 18px; }
.copy-status .bad, .remote-card .bad { color: #ff6b6b; }
.backup-name { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }

/* Apparence : vignettes des thèmes, couleur libre, dégradés */
.theme-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-tile { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface-2); cursor: pointer; text-align: left; }
.theme-tile[aria-pressed="true"] { border-color: var(--accent); }
.theme-preview { display: block; height: 64px; border-radius: 8px; padding: 10px; }
.theme-preview > span { display: flex; align-items: center; justify-content: space-between; height: 100%; border-radius: 6px; padding: 0 8px; }
.theme-preview i { display: block; width: 46%; height: 6px; border-radius: 3px; opacity: .85; }
.theme-preview b { display: block; width: 18px; height: 18px; border-radius: 50%; }
.theme-name { font-size: 13px; font-weight: 600; }
.accent-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.color-pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.color-input { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.swatch.grad { width: 56px; height: 36px; border-radius: 8px; }
.swatch.grad[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.color-input { -webkit-appearance: none; appearance: none; padding: 3px; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-input::-moz-color-swatch { border: 0; border-radius: 5px; }
.color-pick { white-space: nowrap; }
.lib-lang-row { padding: 10px 0; border-top: 1px solid var(--line); }
.lib-lang-row:first-of-type { border-top: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 720px) { .grid3 { grid-template-columns: 1fr; } }

/* =====================================================================================================
   Styles d'interface (Paramètres → Apparence → Style de l'interface) : ils changent la mise en page —
   barre de navigation, cartes, panneaux, grande bannière, fiche — et se combinent avec tous les thèmes.
   Écrits pour Noxa, d'après les familles de thèmes connues des serveurs multimédia (verre dépoli, barre
   latérale, épuré, plein écran, arrondi).
   ===================================================================================================== */
.nav-link { display: inline-flex; align-items: center; gap: 8px; }
.nav-ico { display: none; width: 1.15em; height: 1.15em; }

/* ---------- Verre dépoli : barre flottante, panneaux translucides, bannière en carte ---------- */
:root[data-style="glass"] { --radius: 16px; --glass: color-mix(in srgb, var(--surface) 58%, transparent);
  --glass-line: color-mix(in srgb, var(--text) 11%, transparent); }
:root[data-style="glass"]:not(.has-wallpaper) body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  will-change: transform; transform: translateZ(0);
  background: radial-gradient(70vw 60vh at 0% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(60vw 60vh at 100% 10%, color-mix(in srgb, #4c7dff 16%, transparent), transparent 70%),
    radial-gradient(60vw 50vh at 50% 110%, color-mix(in srgb, #b45cff 12%, transparent), transparent 70%), var(--bg); }
:root[data-style="glass"] .topbar { top: calc(10px + var(--safe-top)); margin: calc(10px + var(--safe-top)) var(--gutter) 0;
  min-height: 62px; padding: 8px 10px 8px 18px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 34px rgba(0, 0, 0, .28); }
:root[data-style="glass"] .topbar.scrolled { background: color-mix(in srgb, var(--surface) 74%, transparent); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
:root[data-style="glass"] .nav-link { border-radius: 99px; padding: 7px 14px; }
:root[data-style="glass"] .nav-link.active { background: color-mix(in srgb, var(--text) 13%, transparent); }
:root[data-style="glass"] .nav-link::after { display: none; }
:root[data-style="glass"] .search { background: color-mix(in srgb, var(--text) 8%, transparent); }
:root[data-style="glass"] .hero { margin: 18px 0 22px; border-radius: 30px; min-height: min(66vh, 620px); border: 1px solid var(--glass-line);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4); }
:root[data-style="glass"] .hero-shade { background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 45%, transparent 75%),
  linear-gradient(0deg, rgba(0, 0, 0, .55) 0%, transparent 45%); }
:root[data-style="glass"] .hero-body { padding: 0 clamp(24px, 4vw, 56px) clamp(32px, 6vh, 56px); }
:root[data-style="glass"] .panel, :root[data-style="glass"] .modal, :root[data-style="glass"] .user-menu, :root[data-style="glass"] .error-box {
  background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--glass-line); border-radius: 22px; }
/* flou réservé à ce qui flotte (menus, fenêtres) : sous chaque panneau, il était recalculé à chaque image du défilement */
:root[data-style="glass"] .modal, :root[data-style="glass"] .user-menu {
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
:root[data-style="glass"] .modal { background: color-mix(in srgb, var(--surface) 82%, transparent); }
:root[data-style="glass"] .btn { border-radius: 99px; }
:root[data-style="glass"] .btn:not(.primary):not(.danger):not(.light) { background: color-mix(in srgb, var(--text) 9%, transparent); border-color: var(--glass-line); }
:root[data-style="glass"] input:not([type="checkbox"]):not([type="range"]):not([type="color"]), :root[data-style="glass"] select {
  border-radius: 14px; background: color-mix(in srgb, var(--bg) 45%, transparent); border-color: var(--glass-line); }
:root[data-style="glass"] .card-img { border: 1px solid var(--glass-line); }
:root[data-style="glass"] .card:hover .card-img, :root[data-style="glass"] .card:focus-visible .card-img {
  box-shadow: 0 0 0 2px var(--accent), 0 18px 44px color-mix(in srgb, var(--accent) 30%, transparent); }
:root[data-style="glass"] .chip { background: color-mix(in srgb, var(--text) 9%, transparent); border: 1px solid var(--glass-line); }
:root[data-style="glass"] .detail-poster { border-radius: 22px; border: 1px solid var(--glass-line); }
:root[data-style="glass"] .settings-link { border-radius: 14px; }

/* ---------- Barre latérale : navigation à gauche (grand écran ; en haut sur téléphone) ---------- */
@media (min-width: 901px) {
  :root[data-style="sidebar"] { --topbar-h: 0px; --side-w: 240px; }
  :root[data-style="sidebar"] .topbar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 60;
    flex-direction: column; align-items: stretch; gap: 16px; min-height: 0; padding: calc(22px + var(--safe-top)) 12px 16px;
    background: var(--surface); border-right: 1px solid var(--line); box-shadow: none; }
  :root[data-style="sidebar"] .topbar.scrolled { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  :root[data-style="sidebar"] .topbar .logo { padding: 0 10px 6px; }
  :root[data-style="sidebar"] .topbar-back { position: absolute; top: calc(22px + var(--safe-top)); right: 10px; }
  :root[data-style="sidebar"] .nav { flex: 1; flex-direction: column; gap: 2px; overflow: hidden auto; }
  :root[data-style="sidebar"] .nav-link { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; }
  :root[data-style="sidebar"] .nav-link:hover { background: var(--surface-2); }
  :root[data-style="sidebar"] .nav-link.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  :root[data-style="sidebar"] .nav-link.active .nav-ico { fill: var(--accent); }
  :root[data-style="sidebar"] .nav-link::after { display: none; }
  :root[data-style="sidebar"] .nav-ico { display: block; }
  :root[data-style="sidebar"] .nav-label { overflow: hidden; text-overflow: ellipsis; }
  :root[data-style="sidebar"] .topbar-right { flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
  :root[data-style="sidebar"] .topbar-right .search { order: -1; flex: 1 1 100%; }
  :root[data-style="sidebar"] .search input.search-input { width: 100%; }
  :root[data-style="sidebar"] .topbar-right > .user-wrap:last-child { margin-left: auto; }
  :root[data-style="sidebar"] .topbar .user-menu { top: auto; bottom: calc(100% + 8px); right: auto; left: 0; transform-origin: bottom left; }
  :root[data-style="sidebar"] .topbar-right > .user-wrap:last-child .user-menu { left: auto; right: 0; transform-origin: bottom right; }
  :root[data-style="sidebar"] .topbar ~ .content, :root[data-style="sidebar"] .topbar ~ .banner-error { margin-left: var(--side-w); }
  :root[data-style="sidebar"] .content { padding-top: 20px; }
  :root[data-style="sidebar"] .hero, :root[data-style="sidebar"] .detail { margin-top: -20px; }
  :root[data-style="sidebar"] .detail { padding-top: 48px; }
  :root[data-style="sidebar"] .audio-bar { left: var(--side-w); }
  :root[data-style="sidebar"] #toasts { left: calc(50% + var(--side-w) / 2); }
}

/* ---------- Épuré : plat, angles droits, titres discrets, aucune ombre ---------- */
:root[data-style="minimal"] { --radius: 3px; --topbar-h: 60px; }
:root[data-style="minimal"] h1, :root[data-style="minimal"] h2, :root[data-style="minimal"] h3, :root[data-style="minimal"] .row-title,
:root[data-style="minimal"] .hero-title, :root[data-style="minimal"] .detail-title, :root[data-style="minimal"] .page-head h1 {
  font-family: var(--sans); letter-spacing: -0.005em; font-weight: 600; }
:root[data-style="minimal"] .topbar, :root[data-style="minimal"] .topbar.scrolled { background: var(--bg); backdrop-filter: none;
  -webkit-backdrop-filter: none; box-shadow: none; border-bottom: 1px solid var(--line); padding-top: calc(8px + var(--safe-top)); padding-bottom: 8px; }
:root[data-style="minimal"] .logo { font: 600 20px var(--sans); letter-spacing: .02em; }
:root[data-style="minimal"] .logo-mark { width: 28px; height: 28px; }
:root[data-style="minimal"] .nav-link { text-transform: uppercase; font-size: 12px; letter-spacing: .12em; }
:root[data-style="minimal"] .nav-link::after { height: 1px; bottom: 0; border-radius: 0; background: var(--text); }
:root[data-style="minimal"] .hero, :root[data-style="minimal"] .detail { margin-top: 0; }
:root[data-style="minimal"] .detail { padding-top: 40px; }
:root[data-style="minimal"] .hero { min-height: min(52vh, 520px); }
:root[data-style="minimal"] .hero-title { font-size: clamp(30px, 4.2vw, 54px); line-height: 1.08; }
:root[data-style="minimal"] .hero-kicker { color: var(--muted); letter-spacing: .2em; font-size: 11px; }
:root[data-style="minimal"] .row-title { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
:root[data-style="minimal"] a.row-title:hover { color: var(--text); }
:root[data-style="minimal"] .card-img { box-shadow: none; border-radius: 3px; }
:root[data-style="minimal"] .card:hover .card-img, :root[data-style="minimal"] .card:focus-visible .card-img { transform: none;
  box-shadow: 0 0 0 1px var(--text); }
:root[data-style="minimal"] .card-title { font-weight: 500; font-size: 13px; }
:root[data-style="minimal"] .panel { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 22px 0 8px; }
:root[data-style="minimal"] .panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
:root[data-style="minimal"] .btn, :root[data-style="minimal"] .chip, :root[data-style="minimal"] .search, :root[data-style="minimal"] .modal,
:root[data-style="minimal"] .user-menu, :root[data-style="minimal"] .detail-poster, :root[data-style="minimal"] .theme-tile,
:root[data-style="minimal"] input:not([type="checkbox"]):not([type="range"]), :root[data-style="minimal"] select { border-radius: 3px; }
:root[data-style="minimal"] .btn:not(.primary):not(.danger):not(.light) { background: transparent; border-color: var(--line); }
:root[data-style="minimal"] .chip { background: transparent; border: 1px solid var(--line); }
:root[data-style="minimal"] .search { background: transparent; border-color: var(--line); backdrop-filter: none; }
:root[data-style="minimal"] .detail-poster, :root[data-style="minimal"] .user-menu, :root[data-style="minimal"] .modal { box-shadow: none; }
:root[data-style="minimal"] .detail-backdrop { opacity: .22; }
:root[data-style="minimal"] .toggle-ui, :root[data-style="minimal"] .toggle-ui::after { border-radius: 2px; }

/* ---------- Cinéma : bannière plein écran, titres sur les affiches, fiche en grand ---------- */
@media (min-width: 761px) { :root[data-style="cinema"] .nav { justify-content: safe center; } }
:root[data-style="cinema"] .nav-link { text-transform: uppercase; font-size: 13px; letter-spacing: .1em; }
:root[data-style="cinema"] .hero { min-height: 100vh; min-height: 100svh; align-items: center; }
:root[data-style="cinema"] .hero-shade { background: radial-gradient(120% 90% at 75% 35%, transparent 25%, rgba(0, 0, 0, .8) 100%),
  linear-gradient(90deg, rgba(0, 0, 0, .75) 0%, transparent 60%), linear-gradient(0deg, var(--bg) 0%, transparent 32%); }
:root[data-style="cinema"] .hero-body { max-width: 900px; padding-top: calc(var(--topbar-h) + 40px); }
:root[data-style="cinema"] .hero-title { font-size: clamp(46px, 8vw, 116px); text-transform: uppercase; letter-spacing: -0.015em; line-height: .92; }
:root[data-style="cinema"] .hero-summary { font-size: 18px; }
:root[data-style="cinema"] .row { margin-bottom: 38px; }
:root[data-style="cinema"] .row-title { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .18em; }
:root[data-style="cinema"] .row-title::before { content: ""; width: 4px; height: 1.2em; border-radius: 2px; background: var(--accent); }
:root[data-style="cinema"] .card { transition: transform .28s cubic-bezier(.2, .8, .2, 1); position: relative; }
:root[data-style="cinema"] .card:hover, :root[data-style="cinema"] .card:focus-visible { transform: scale(1.07); z-index: 2; }
:root[data-style="cinema"] .card:hover .card-img, :root[data-style="cinema"] .card:focus-visible .card-img { transform: none;
  box-shadow: 0 0 0 2px var(--accent), 0 22px 50px rgba(0, 0, 0, .6); }
:root[data-style="cinema"] .card.poster .card-sub { display: none; }
:root[data-style="cinema"] .card.poster .card-title { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 48px 10px 10px;
  border-radius: 0 0 var(--radius) var(--radius); background: linear-gradient(transparent, rgba(0, 0, 0, .88)); color: #fff;
  white-space: normal; line-height: 1.25; opacity: 0; transition: opacity .2s; pointer-events: none; }
:root[data-style="cinema"] .card.poster:hover .card-title, :root[data-style="cinema"] .card.poster:focus-visible .card-title,
:root[data-style="cinema"] .card.poster:has(.noimg) .card-title { opacity: 1; }
:root[data-style="cinema"] .card.poster:has(.noimg) .noimg { color: transparent; }
:root[data-style="cinema"] .detail { min-height: 88vh; display: flex; align-items: flex-end;
  padding-top: calc(var(--topbar-h) + var(--safe-top) + 28vh); }
:root[data-style="cinema"] .detail-backdrop { opacity: .9; mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); }
:root[data-style="cinema"] .detail-backdrop::after { background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 45%, transparent 80%),
  linear-gradient(0deg, var(--bg) 0%, transparent 45%); }
:root[data-style="cinema"] .detail-inner { align-items: flex-end; width: 100%; }
:root[data-style="cinema"] .detail-poster { width: min(18vw, 180px); }
:root[data-style="cinema"] .detail-title { font-size: clamp(38px, 6vw, 84px); text-transform: uppercase; letter-spacing: -0.01em; }
:root[data-style="cinema"] .panel { border-radius: 8px; }

/* ---------- Arrondi : formes très arrondies, menu en pastilles, boutons en dégradé ---------- */
:root[data-style="rounded"] { --radius: 22px; --grad: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ff3d8b)); }
:root[data-style="rounded"] .nav { flex: 0 1 auto; margin: 0 auto; padding: 4px; gap: 2px; border-radius: 99px;
  background: color-mix(in srgb, var(--text) 8%, transparent); }
:root[data-style="rounded"] .nav-link { border-radius: 99px; padding: 7px 15px; }
:root[data-style="rounded"] .nav-link.active { background: var(--grad); color: var(--ink-on-accent); }
:root[data-style="rounded"] .nav-link::after { display: none; }
:root[data-style="rounded"] .nav-ico { display: block; width: 1em; height: 1em; }
:root[data-style="rounded"] .hero { border-radius: 0 0 44px 44px; }
:root[data-style="rounded"] .btn { border-radius: 99px; }
:root[data-style="rounded"] .btn.primary { background: var(--grad); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-style="rounded"] .panel { border-radius: 28px; border-color: transparent; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
:root[data-style="rounded"] .modal, :root[data-style="rounded"] .user-menu { border-radius: 26px; }
:root[data-style="rounded"] .user-menu a, :root[data-style="rounded"] .user-menu button { border-radius: 16px; }
:root[data-style="rounded"] input:not([type="checkbox"]):not([type="range"]), :root[data-style="rounded"] select { border-radius: 16px; }
:root[data-style="rounded"] .card:hover .card-img, :root[data-style="rounded"] .card:focus-visible .card-img {
  transform: translateY(-6px) scale(1.04); box-shadow: 0 0 0 3px var(--accent), 0 20px 44px color-mix(in srgb, var(--accent) 28%, transparent); }
:root[data-style="rounded"] .progress { left: 10px; right: 10px; bottom: 10px; height: 6px; border-radius: 99px; overflow: hidden; }
:root[data-style="rounded"] .progress-fill { background: var(--grad); border-radius: 99px; }
:root[data-style="rounded"] .chip { background: color-mix(in srgb, var(--accent) 15%, transparent); }
:root[data-style="rounded"] .detail-poster { border-radius: 28px; }
:root[data-style="rounded"] .row-title { font-weight: 800; }
:root[data-style="rounded"] .settings-link { border-radius: 99px; }
@media (max-width: 760px) {
  :root[data-style="rounded"] .nav { margin: 0; }
  :root[data-style="glass"] .topbar { margin: calc(8px + var(--safe-top)) 10px 0; border-radius: 18px; }
  :root[data-style="glass"] .hero { border-radius: 22px; }
}

/* ---------- maquettes des styles (Paramètres → Apparence) ---------- */
.style-tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.style-hint { font-size: 12px; color: var(--muted); line-height: 1.35; text-align: left; }
.style-tile .theme-name { text-align: left; }
.style-preview { position: relative; display: flex; flex-direction: column; gap: 5px; height: 92px; padding: 6px; overflow: hidden;
  border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.sp-bar { display: flex; align-items: center; gap: 4px; height: 10px; flex: none; }
.sp-bar i { display: block; width: 16px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .7; }
.sp-bar i:first-child { width: 10px; background: var(--accent); opacity: 1; }
.sp-main { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sp-hero { flex: 1; border-radius: 4px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 55%, #222), #2a2f3a); }
.sp-row { display: flex; gap: 4px; height: 24px; }
.sp-row b { flex: 1; border-radius: 3px; background: var(--surface-2); }
.style-preview[data-s="glass"] { background: radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
  radial-gradient(circle at 100% 20%, rgba(76, 125, 255, .35), transparent 60%), var(--bg); }
.style-preview[data-s="glass"] .sp-bar { margin: 0 6px; padding: 0 5px; height: 12px; border-radius: 6px;
  background: color-mix(in srgb, var(--text) 14%, transparent); }
.style-preview[data-s="glass"] .sp-hero { margin: 0 6px; border-radius: 8px; }
.style-preview[data-s="glass"] .sp-row b { border-radius: 5px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.style-preview[data-s="sidebar"] { flex-direction: row; }
.style-preview[data-s="sidebar"] .sp-bar { flex-direction: column; align-items: flex-start; width: 30px; height: auto; padding: 4px;
  border-radius: 4px; background: var(--surface-2); }
.style-preview[data-s="sidebar"] .sp-bar i { width: 100%; }
.style-preview[data-s="minimal"] .sp-bar { border-bottom: 1px solid var(--line); padding-bottom: 4px; height: 12px; }
.style-preview[data-s="minimal"] .sp-bar i { height: 2px; border-radius: 0; }
.style-preview[data-s="minimal"] .sp-hero, .style-preview[data-s="minimal"] .sp-row b { border-radius: 0; }
.style-preview[data-s="minimal"] .sp-hero { flex: .7; background: color-mix(in srgb, var(--text) 18%, var(--bg)); }
.style-preview[data-s="minimal"] .sp-row b { background: transparent; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); }
.style-preview[data-s="cinema"] { padding: 0; }
.style-preview[data-s="cinema"] .sp-bar { position: absolute; top: 4px; left: 0; right: 0; justify-content: center; z-index: 1; }
.style-preview[data-s="cinema"] .sp-hero { flex: 2; border-radius: 0; background: radial-gradient(circle at 70% 40%, #5a4a3a, #000 80%); }
.style-preview[data-s="cinema"] .sp-row { padding: 0 6px 6px; height: 22px; }
.style-preview[data-s="rounded"] .sp-bar { justify-content: center; }
.style-preview[data-s="rounded"] .sp-bar i { width: 18px; height: 8px; border-radius: 99px; }
.style-preview[data-s="rounded"] .sp-bar i:first-child { width: 18px; background: linear-gradient(135deg, var(--accent), #ff3d8b); }
.style-preview[data-s="rounded"] .sp-hero { border-radius: 0 0 12px 12px; }
.style-preview[data-s="rounded"] .sp-row b { border-radius: 8px; }

/* ---------- effets visuels allégés (Paramètres → Cet appareil) : pour une TV ou un appareil modeste ---------- */
html.lite *, html.lite *::before, html.lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite.has-wallpaper body::before { filter: none; inset: 0;
  background: linear-gradient(color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 96%, transparent) 70%),
    var(--wallpaper) center / cover no-repeat; }
html.lite .card-img, html.lite .detail-poster, html.lite .panel, html.lite .hero { box-shadow: none !important; }
html.lite .card-img, html.lite .card { transition: none !important; }
html.lite .topbar.scrolled, html.lite .user-menu, html.lite .modal { background: var(--surface); }
html.lite .topbar.scrolled { background: var(--bg); }

/* =====================================================================================================
   Thèmes installés (magasin de thèmes) : couleurs en variables (posées par app.js), fond, police et effets
   choisis dans une liste fixe. Rien d'autre ne vient du thème.
   ===================================================================================================== */
:root { --accent-2: var(--accent); }
:root[data-style="glass"]:not(.has-wallpaper) body, :root.has-theme-bg:not(.has-wallpaper) body { background: transparent; }
:root.has-theme-bg:not(.has-wallpaper) body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  will-change: transform; transform: translateZ(0); background: var(--theme-bg), var(--bg); background-size: var(--theme-bg-size), auto; }
:root[data-font="mono"] { --sans: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; --display: var(--sans); }
:root[data-font="serif"] { --display: Georgia, "Times New Roman", "Liberation Serif", serif; }
:root[data-font="rounded"] { --display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", var(--sans); --sans: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; }
/* néon : lueur sur les titres, le lien actif et les boutons */
:root[data-fx~="neon"] .hero-title, :root[data-fx~="neon"] .detail-title, :root[data-fx~="neon"] .page-head h1, :root[data-fx~="neon"] .logo {
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 2px var(--accent); }
:root[data-fx~="neon"] .nav-link.active { color: var(--accent); text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 80%, transparent); }
:root[data-fx~="neon"] .row-title { text-shadow: 0 0 12px color-mix(in srgb, var(--accent-2) 55%, transparent); }
:root[data-fx~="neon"] .btn.primary { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 2px var(--accent); }
:root[data-fx~="neon"] .panel { border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
/* lueur des affiches survolées */
:root[data-fx~="glow"] .card:hover .card-img, :root[data-fx~="glow"] .card:focus-visible .card-img {
  box-shadow: 0 0 0 2px var(--accent), 0 0 34px color-mix(in srgb, var(--accent-2) 50%, transparent); }
:root[data-fx~="glow"] .btn.primary { box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 35%, transparent); }
/* calques de texture (lignes d'écran, grain, vignettage) : DERRIÈRE l'interface, sur le fond de la page seulement —
   jamais par-dessus le texte, les affiches ou l'avatar, ni pendant la lecture d'une vidéo */
:root[data-fx~="scanlines"] { --fx-scan: repeating-linear-gradient(0deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px); }
:root[data-fx~="vignette"] { --fx-vig: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%); }
:root[data-fx~="grain"] { --fx-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E"); }
:root[data-overlay] body { background: transparent; }
:root[data-overlay] body:not(.playing)::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--fx-grain, none), var(--fx-scan, none), var(--fx-vig, none); background-size: 180px 180px, auto, auto; }
html.lite[data-overlay] body::after { display: none; }
html.lite[data-fx] * { text-shadow: none !important; }

/* ---------- magasin de thèmes ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.store-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); min-width: 0; }
.store-card.on { border-color: var(--accent); }
.store-preview { position: relative; height: 104px; border-radius: 10px; overflow: hidden; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.store-preview .sp-bar { height: 10px; display: flex; gap: 5px; align-items: center; }
.store-preview .sp-bar i { width: 18px; height: 4px; border-radius: 2px; opacity: .8; }
.store-preview .sp-panel { flex: 1; border-radius: 6px; display: flex; align-items: flex-end; justify-content: space-between; padding: 8px; }
.store-preview .sp-title { font-weight: 800; font-size: 15px; }
.store-preview .sp-btn { padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.store-preview.fx-neon .sp-title { text-shadow: 0 0 10px currentColor; }
.store-preview.fx-scanlines::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px); }
.store-preview.fx-vignette::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .6) 100%); }
.store-name { font-weight: 700; }
.store-meta { font-size: 12px; color: var(--muted); }
.store-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); }
.store-desc { font-size: 13px; color: var(--muted); line-height: 1.4; flex: 1; }
.store-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.store-tags span { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.store-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-editor .grid-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.theme-editor .color-field { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.theme-editor .color-field input[type="color"] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; flex: none; }
.theme-problems { margin: 8px 0 0; padding-left: 18px; color: var(--danger); font-size: 13px; }
.store-grid.mini { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.store-grid.mini .store-preview { height: 64px; padding: 7px; }
.store-grid.mini .store-preview .sp-title { font-size: 12px; }
.theme-sub { margin: 16px 0 8px; color: var(--muted); }
.preview-bar { position: sticky; top: calc(var(--topbar-h) + var(--safe-top) + 8px); z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.theme-editor .grad-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.theme-editor .grad-row input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; flex: none; }
.theme-editor .grad-angle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; }
.theme-editor .grad-angle input { flex: 1; }
.theme-editor .store-preview { height: 90px; }

/* ---------- téléchargements : outils de sélection, espace occupé, téléchargements intelligents ---------- */
.dl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.dl-tools select { width: auto; padding: 6px 10px; font-size: 13px; }
.dl-sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.dl-check { width: 20px; height: 20px; accent-color: var(--accent); flex: none; cursor: pointer; }
.dl-row.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
.dl-meter { margin-bottom: 6px; }
.dl-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-2); max-width: 520px; margin: 6px 0; }
.dl-bar .films, .dl-legend i.films { background: var(--accent); }
.dl-bar .shows, .dl-legend i.shows { background: color-mix(in srgb, var(--accent-2, var(--accent)) 55%, var(--muted)); }
.dl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin: 0 4px 0 6px; vertical-align: -1px; }
.dl-legend i:first-child { margin-left: 0; }
.dl-smart { margin: 6px 0 4px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.dl-smart summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dl-smart p { margin: 8px 0 0; }

/* ---------- sélection multiple (bibliothèques) ---------- */
.selecting a[href^="#/item/"] { cursor: pointer; }
.selecting .card .card-img::after, .selecting .lib-row::after { content: ''; position: absolute; top: 8px; left: 8px; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .45); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.selecting .lib-row { position: relative; }
.selecting .sel .card-img::after, .selecting .lib-row.sel::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23111'/%3E%3C/svg%3E") center / 16px no-repeat; border-color: var(--accent); }
.selecting .sel .card-img { box-shadow: 0 0 0 3px var(--accent); }
.selecting .lib-row.sel { outline: 2px solid var(--accent); }
.selecting .card-flags { left: 36px; }
.bulk-bar { position: sticky; bottom: 12px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px auto 0;
  padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35); width: fit-content; max-width: 100%; }
.bulk-bar.busy { opacity: .6; pointer-events: none; }
.bulk-sep { width: 1px; height: 22px; background: var(--line); }
.bulk-count { margin-right: 4px; white-space: nowrap; }
html.has-audio .bulk-bar { bottom: 108px; }

/* ---------- statistiques (administration) ---------- */
.stats-head { margin: 0 0 14px; }
.stats-head select { width: auto; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font: 800 28px/1.2 var(--display); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.stat-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.stat-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; cursor: default; }
.stat-col span { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.stat-col:hover span { filter: brightness(1.2); }
.stat-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stat-table td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-variant-numeric: tabular-nums; }
.stat-table td a { color: inherit; }
.stat-table td a:hover { color: var(--accent); }
.stat-tiles ~ .panel { margin-bottom: 14px; }

/* ---------- applications (page Applications, bouton Installer) ---------- */
.app-lead { max-width: 70ch; margin: -8px 0 18px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.app-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.app-card.here { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head h2 { font-size: 19px; }
.app-logo { position: relative; display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--surface-2); color: var(--text); }
.platform-logo { fill: currentColor; display: block; }
.logo-android { fill: #3ddc84; }
.app-tv { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--ink-on-accent); }
.app-tv .icon { width: 14px; height: 14px; }
.app-here { margin-left: auto; align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--accent); color: var(--ink-on-accent); white-space: nowrap; }
.app-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-size { font-weight: 400; opacity: .7; font-size: 12px; }
.btn.disabled { opacity: .45; cursor: not-allowed; }
.app-steps summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.app-steps ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.app-steps li + li { margin-top: 4px; }
.install-choices { display: flex; flex-direction: column; gap: 10px; }
.modal:has(.install-all) { max-width: 920px; }
.install-all .install-sub { font-size: 15px; margin: 4px 0 10px; color: var(--muted); font-weight: 600; }
.install-all .install-sub + .app-grid, .install-all .install-choices + .install-sub { margin-top: 18px; }
.install-all .app-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.user-menu .apps-link[hidden] { display: none; }
.install-choice { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.install-choice.recommended { border-color: var(--accent); }
.install-choice p { margin: 4px 0 0; }
.install-tag { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--ink-on-accent); }
@media (max-width: 520px) { .install-choice { flex-wrap: wrap; } .install-choice .btn { width: 100%; justify-content: center; } }
/* aperçus du magasin : la texture reste sous la barre et le panneau, comme dans l'interface */
.store-preview > * { position: relative; z-index: 1; }
.store-preview::before, .store-preview::after { z-index: 0; }

/* stockage froid : bibliothèques et moyen de suppression */
.cold-libs { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.cold-lib { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cold-lib .check { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.cold-bar { margin-top: 6px; }

/* paramètres : sous-onglets d'une page qui réunit plusieurs sujets (défilent sur téléphone) */
.settings-subtabs, .cold-tabs { margin: 2px 0 18px; flex-wrap: wrap; overflow: visible; }
.settings-subtabs .tab, .cold-tabs .tab { flex: none; white-space: nowrap; text-decoration: none; }

/* menu ⋯ : sur téléphone, en bas de l'écran (jamais coupé) ; ailleurs, recalé pour rester dans la fenêtre */
.more-list.floating { position: fixed; z-index: 310; overscroll-behavior: contain; }
.more-list.more-fade { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
.more-list.sheet { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  min-width: 0; max-width: none; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; z-index: 310; border-radius: 16px;
  overscroll-behavior: contain;
  animation: sheet-in 0.2s var(--ease-out, ease-out); }
.more-list.sheet .more-item { padding: 11px 14px; font-size: 16px; }
.more-backdrop { position: fixed; inset: 0; z-index: 309; background: rgba(0, 0, 0, 0.45); }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
