/* ═══════════════════════════════════════════════════════════════════════════
   TwitchUnblock — feuille de style.
   Mêmes couleurs, rayons et graisses que l'app iOS (DesignSystem.swift).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0e0e10;
  --card: #18181b;
  --card-hi: #1f1f23;
  --surface: #26262c;
  --surface-hi: #303036;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: #3a3a40;
  --text: #efeff1;
  --muted: #adadb8;
  --primary: #9146ff;
  --primary-hi: #a970ff;
  --purple: #bf94ff;
  --primary-rgb: 145, 70, 255;
  --purple-rgb: 191, 148, 255;
  --on-primary: #fff;
  --live: #e91916;
  --danger: #ff4f4d;
  --success: #00c878;

  --r-card: 14px;
  --r-control: 10px;
  --r-chip: 8px;

  --chat-w: 360px;
  --head-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }

/* ── Thèmes (Réglages → Apparence) ─────────────────────────────────────── */
/* Fonds de l'app (sombre par défaut, noir OLED, ardoise), et un fond clair. */
:root[data-bg="oled"] { --bg: #000000; --card: #0e0e10; --card-hi: #141417; --surface: #1c1c1f; --surface-hi: #26262b; --line-strong: #2e2e33; }
:root[data-bg="slate"] { --bg: #0f141c; --card: #171e29; --card-hi: #1d2531; --surface: #232c3a; --surface-hi: #2b3647; --line-strong: #35404f; --muted: #a7b1c2; }
/* Couleurs d'accent de l'app : la principale, et sa version claire pour les
   textes mis en avant (--purple, nom historique). */
:root[data-accent="blue"] { --primary: #2f7cf6; --primary-hi: #5a98f8; --purple: #8ab8ff; --primary-rgb: 47, 124, 246; --purple-rgb: 138, 184, 255; }
:root[data-accent="green"] { --primary: #10b981; --primary-hi: #34d399; --purple: #6ee7b7; --primary-rgb: 16, 185, 129; --purple-rgb: 110, 231, 183; --on-primary: #0e0e10; }
:root[data-accent="pink"] { --primary: #ec4899; --primary-hi: #f472b6; --purple: #f9a8d4; --primary-rgb: 236, 72, 153; --purple-rgb: 249, 168, 212; }
:root[data-accent="orange"] { --primary: #f97316; --primary-hi: #fb923c; --purple: #fdba74; --primary-rgb: 249, 115, 22; --purple-rgb: 253, 186, 116; --on-primary: #0e0e10; }
:root[data-accent="red"] { --primary: #e5484d; --primary-hi: #ee6b6f; --purple: #ff9c9f; --primary-rgb: 229, 72, 77; --purple-rgb: 255, 156, 159; }
:root[data-accent="teal"] { --primary: #06b6d4; --primary-hi: #22d3ee; --purple: #67e8f9; --primary-rgb: 6, 182, 212; --purple-rgb: 103, 232, 249; --on-primary: #0e0e10; }
/* Fond clair : texte foncé, et la couleur d'accent elle-même pour les
   textes (sa version claire ne se lirait pas sur blanc). */
:root[data-bg="light"] {
  color-scheme: light;
  --bg: #f3f3f6; --card: #ffffff; --card-hi: #f7f7fa; --surface: #eaeaf0; --surface-hi: #e0e0e8;
  --line: rgba(0, 0, 0, 0.09); --line-strong: #d6d6de; --text: #18181c; --muted: #5f5f6b; --purple: var(--primary);
  --purple-rgb: var(--primary-rgb);
}
/* Fond clair : version foncée de l'accent pour les textes (bleu, vert, rose,
   orange et sarcelle passaient sous 4,5:1 sur blanc). */
:root[data-bg="light"][data-accent="blue"] { --purple: #1d4ed8; --purple-rgb: 29, 78, 216; }
:root[data-bg="light"][data-accent="green"] { --purple: #047857; --purple-rgb: 4, 120, 87; }
:root[data-bg="light"][data-accent="pink"] { --purple: #be185d; --purple-rgb: 190, 24, 93; }
:root[data-bg="light"][data-accent="orange"] { --purple: #c2410c; --purple-rgb: 194, 65, 12; }
:root[data-bg="light"][data-accent="teal"] { --purple: #0e7490; --purple-rgb: 14, 116, 144; }
/* Ce qui était blanc sur fond sombre, sans passer par une variable. */
:root[data-bg="light"] .segmented button.active, :root[data-bg="light"] .nav button.active { color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-bg="light"] .icon-btn:hover, :root[data-bg="light"] .emote-cells button:hover, :root[data-bg="light"] .mb-chip button:hover { background: rgba(0, 0, 0, 0.06); }
:root[data-bg="light"] .msg:hover { background: rgba(0, 0, 0, 0.035); }
:root[data-bg="light"] .mention { background: rgba(0, 0, 0, 0.07); }
:root[data-bg="light"] .mention.self { color: var(--text); background: color-mix(in srgb, var(--primary) 22%, transparent); }
:root[data-bg="light"] .spinner { border-color: rgba(0, 0, 0, 0.12); border-top-color: var(--primary); }
:root[data-bg="light"] .login-card p { color: var(--muted); }
:root[data-bg="light"] .chat-mode, :root[data-bg="light"] .chat-banned { color: #8a6d00; background: rgba(230, 180, 0, 0.14); }
:root[data-bg="light"] .fb-kind.bug, :root[data-bg="light"] .fb-status.refused { color: #c42b2b; }
:root[data-bg="light"] :is(.msg-name, .pin-sender) { filter: brightness(0.62) saturate(1.3); }
:root[data-bg="light"] :is(.player, .watch-body:fullscreen .chat, .watch-body:-webkit-full-screen .chat) :is(.msg-name, .pin-sender) { filter: none; }
:root[data-bg="light"] .fb-status.accepted { color: #1d5fb8; }
:root[data-bg="light"] .fb-status.progress { color: #8a6d00; }
:root[data-bg="light"] .fb-status.done { color: #0b7a4c; }
/* Le lecteur reste noir quel que soit le thème : lui, son menu, l'écran de
   fin de live, le chat posé sur l'image en plein écran et les tuiles du
   multi-live gardent la palette sombre (sinon texte et icônes foncés sur
   fond noir). */
:root[data-bg="light"] :is(.player, .watch-ended, .watch-body:fullscreen .chat, .watch-body:-webkit-full-screen .chat, .mtile, .watch-error, .watch-loading) {
  --bg: #0e0e10; --card: #18181b; --card-hi: #1f1f23; --surface: #26262c; --surface-hi: #303036;
  --line: rgba(255, 255, 255, 0.08); --line-strong: #3a3a40; --text: #efeff1; --muted: #adadb8;
  color: var(--text);
}

/* Réglages : pastilles des couleurs d'accent. */
.accent-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.accent-swatches .swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line-strong); }
.accent-swatches .swatch.on { box-shadow: 0 0 0 2px var(--sw); }
html.watching { overflow: hidden; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: 0.45; cursor: default; }
a { color: inherit; text-decoration: none; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
::selection { background: rgba(var(--primary-rgb), 0.45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
input[type='search']::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
:root[data-bg="light"] input[type='search']::-webkit-search-cancel-button { filter: opacity(0.5); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-control);
  background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover { background: var(--surface-hi); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hi); }
.btn.ghost { background: transparent; border: 1px solid var(--line-strong); }
.btn.ghost:hover { border-color: var(--purple); background: rgba(var(--primary-rgb), 0.08); }
.btn.danger { background: rgba(255, 79, 77, 0.14); color: var(--danger); }
.btn.danger:hover { background: rgba(255, 79, 77, 0.24); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.full { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--r-control); color: var(--text);
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.link-btn { color: var(--purple); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--line); }
.segmented button { padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.segmented.full { display: flex; }
.segmented.full button { flex: 1; }
/* Langues (cinq choix avec « Appareil ») : sur un écran étroit, elles passent
   sur deux lignes au lieu de déborder (« Русский » sortait du cadre). */
.segmented.langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.segmented.langs button { padding: 6px 8px; white-space: nowrap; }

/* ── Barre du haut ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: calc(64px + var(--safe-t)); padding: var(--safe-t) 24px 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.45);
}
.brand-name b { color: var(--purple); font-weight: 800; }
.nav { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.nav button { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 14px; transition: background 0.15s, color 0.15s; }
.nav button:hover { color: var(--text); }
.nav button.active { background: var(--surface); color: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.feedback-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 999px; flex: none;
  border: 1px solid rgba(var(--purple-rgb), 0.35); background: rgba(var(--primary-rgb), 0.10);
  color: var(--purple); font-weight: 600; font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover { background: rgba(var(--primary-rgb), 0.2); border-color: var(--purple); }
/* Écran moyen ou petit : l'icône seule, la barre n'a pas la place du texte. */
@media (max-width: 1200px) {
  .feedback-btn { width: 36px; padding: 0; }
  .feedback-btn-label { display: none; }
}
.feedback-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border-radius: var(--r-control); border: 1px solid rgba(var(--purple-rgb), 0.35);
  background: rgba(var(--primary-rgb), 0.10); color: var(--text); text-align: left;
  transition: background 0.15s;
}
.feedback-card:hover { background: rgba(var(--primary-rgb), 0.18); }
.feedback-card-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(var(--primary-rgb), 0.22); color: var(--purple); }
.feedback-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feedback-card-text small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.feedback-card > svg { flex: none; color: var(--muted); }
/* Réglages → Installer l'app : même gabarit, mais aux couleurs de l'accent choisi. */
.install-card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-control); border: 1px solid rgba(var(--purple-rgb), 0.35);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: rgba(var(--primary-rgb), 0.10);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.install-card-head { display: flex; align-items: center; gap: 12px; }
.install-card-ic {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--purple);
  background: rgba(var(--primary-rgb), 0.22);
  background: color-mix(in srgb, var(--primary) 22%, transparent);
}
.install-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-card-text small { color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.install-card .btn { align-self: flex-start; }
.install-steps { padding-left: 18px; font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.push-status { margin: 2px 0 8px; line-height: 1.45; }
.push-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.whats-new-actions { display: flex; flex-direction: column; gap: 8px; }
.whats-new-actions .btn { width: 100%; justify-content: center; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r-control);
  background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 14px;
  transition: background 0.15s, box-shadow 0.15s;
}
.account-btn:hover { background: var(--primary-hi); }
.account-btn.logged { width: 38px; padding: 0; border-radius: 50%; overflow: hidden; justify-content: center; background: var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.account-btn.logged:hover { box-shadow: 0 0 0 2px var(--purple); }
.account-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-btn .initial { font-weight: 800; }

/* Barre d'onglets du bas, sur mobile */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; grid-template-columns: repeat(4, 1fr);
  height: calc(62px + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.tabbar button.active { color: var(--purple); }

/* ── Contenu ───────────────────────────────────────────────────────────── */
.content { max-width: 1480px; margin: 0 auto; padding: 28px 24px 64px; }
.view { animation: fade 0.25s ease; }
.block { margin-bottom: 40px; }

/* Annonce du développeur (publiée depuis /stats) */
#announcement { margin-bottom: 28px; }
.announce { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(var(--purple-rgb), 0.45); background: linear-gradient(rgba(var(--primary-rgb), 0.10), rgba(var(--primary-rgb), 0.10)), var(--card); }
.announce-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--purple)); }
.announce-body { flex: 1; min-width: 0; }
.announce-body h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.announce-body p { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.announce-body .btn { margin-top: 10px; }
.announce .icon-btn { flex: none; margin: -6px -8px 0 0; }
.announce-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.announce-reacts button { height: 32px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; line-height: 1; cursor: pointer; transition: transform 0.1s, border-color 0.15s, background 0.15s; }
.announce-reacts button:hover { border-color: var(--purple); }
.announce-reacts button:active { transform: scale(0.92); }
.announce-reacts button.on { border-color: var(--purple); background: rgba(var(--primary-rgb), 0.22); }
/* Sondage du développeur : même carte que l'annonce, choix puis barres. */
#announcement:not([hidden]) + #poll { margin-top: 12px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.poll-options button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.poll-options button:hover { border-color: var(--purple); }
.poll-options button.on { border-color: var(--purple); background: rgba(var(--primary-rgb), 0.22); }
.poll-options button:disabled { opacity: 0.6; cursor: default; }
.poll-box { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); }
.poll-options button.on .poll-box { border-color: var(--purple); background: var(--purple); color: #fff; }
.poll-results { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.poll-results li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px; border-radius: 10px; background: var(--surface); overflow: hidden; }
.poll-bar { position: absolute; inset: 0 auto 0 0; width: var(--pct); background: rgba(var(--primary-rgb), 0.18); }
.poll-results li.mine .poll-bar { background: rgba(var(--primary-rgb), 0.34); }
.poll-opt { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.poll-pct { position: relative; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.announce-body .poll-meta { margin-top: 8px; font-size: 12.5px; }
.poll-meta .link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; }
/* Nouvelle version de TwitchUnblock Connect : une ligne discrète, au-dessus
   des pages (connect-update.js) ; les étapes dans « Comment mettre à jour ? ». */
#connect-update { margin-bottom: 20px; }
.cx-update { display: flex; align-items: flex-start; gap: 10px; padding: 7px 6px 7px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); font-size: 13px; }
.cx-update-ic { flex: none; display: grid; place-items: center; height: 34px; color: var(--purple); }
.cx-update-body { flex: 1; min-width: 0; padding-top: 8px; }
.cx-update-body p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cx-update-body b { font-weight: 600; }
.cx-update-body .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.cx-update details { margin-top: 4px; color: var(--muted); }
.cx-update summary { width: fit-content; cursor: pointer; padding-bottom: 6px; }
.cx-update summary:hover { color: var(--text); }
.cx-update ul { margin: 0 0 6px; padding-left: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.cx-update li + li { margin-top: 4px; }
.cx-update .icon-btn { color: var(--muted); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.block-head h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.block-head h2 .ic { color: var(--purple); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 22px 16px; }
.grid.vods { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.block-tools { display: inline-flex; gap: 4px; }
/* Accueil en liste (façon Twitch) : miniature à gauche, infos à droite. */
.grid.as-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px 20px; }
.grid.as-list .stream-card { display: flex; gap: 12px; align-items: flex-start; }
.grid.as-list .stream-card .thumb { flex: none; width: 168px; border-radius: 10px; }
.grid.as-list .stream-card .pill.uptime, .grid.as-list .stream-card .pill.live { display: none; }
.grid.as-list .stream-card .card-body { flex: 1; min-width: 0; padding: 0; }
.grid.as-list .stream-card .card-body .avatar { display: none; }
.grid.as-list .stream-card h3 { order: 2; font-weight: 500; color: var(--muted); -webkit-line-clamp: 2; }
.grid.as-list .stream-card .card-text { display: flex; flex-direction: column; }
.grid.as-list .stream-card .name { order: 1; margin: 0 0 2px; font-size: 15px; font-weight: 700; color: var(--text); }
.grid.as-list .stream-card .meta { order: 3; color: var(--purple); font-weight: 600; }
.grid.as-list .stream-card .tags { order: 4; }
@media (max-width: 520px) { .grid.as-list .stream-card .thumb { width: 136px; } }
.follow-local { margin-left: auto; }
.follow-local.on { color: var(--danger); border-color: var(--danger); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 14px;
  overflow-x: auto; padding: 4px 2px 10px; margin: -4px -2px 0;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
.playlist + .playlist { margin-top: 22px; }
.playlist-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.playlist-head h3 { font-size: 16px; font-weight: 700; }
.playlist-sub { margin: 2px 0 10px; font-size: 13px; }
.playlist .rail { grid-auto-columns: 232px; }
@media (max-width: 520px) { .playlist .rail { grid-auto-columns: 180px; } }

/* ── Cartes ────────────────────────────────────────────────────────────── */
.card { position: relative; cursor: pointer; border-radius: var(--r-card); outline: none; min-width: 0; }
/* Cartes en liens (<a>) : ouvrables dans un nouvel onglet. */
a.card, a.cat-card { display: block; }
.card .thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 12px; background: var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.card:hover .thumb, .card:focus-visible .thumb { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--primary), 0 14px 30px rgba(var(--primary-rgb), 0.25); }
.card:hover .thumb img { transform: scale(1.04); }
.card-body { display: flex; gap: 10px; padding: 10px 2px 0; }
.card-text { flex: 1; min-width: 0; }
.card h3 { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .name { margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--purple); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tags d'un live (langue, DropsEnabled…) : une ligne, le reste masqué. */
.tags { display: flex; flex-wrap: wrap; gap: 4px; height: 20px; overflow: hidden; margin-top: 6px; }
.tag { max-width: 100%; padding: 0 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-text .tags { margin-top: 8px; }
/* Pseudo et catégorie d'une carte : ouvrent la chaîne ou la catégorie. */
.card-link { cursor: pointer; }
.card-link:hover { text-decoration: underline; text-underline-offset: 2px; color: var(--text); }
.hero-game .card-link:hover { color: var(--purple); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 7px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill.live { background: var(--live); text-transform: uppercase; letter-spacing: 0.03em; font-size: 11px; }
.pill.off { background: var(--surface); color: var(--muted); text-transform: uppercase; font-size: 11px; }
.pill.vod { background: var(--primary); color: var(--on-primary); font-size: 11px; }
.pill.sm { height: 19px; padding: 0 6px; font-size: 10px; }
.thumb > .pill { position: absolute; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.thumb > .pill.live { top: 8px; left: 8px; }
.thumb > .pill.viewers { bottom: 8px; left: 8px; }
.thumb > .pill.uptime { top: 8px; right: 8px; }
.thumb > .pill.duration { bottom: 8px; right: 8px; }
.thumb .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.25); }
.thumb .progress span { display: block; height: 100%; background: var(--primary); }
.thumb .del {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.thumb .del:hover { background: var(--danger); }
.card:hover .del, .card:focus-within .del { opacity: 1; }
@media (hover: none) { .thumb .del { opacity: 1; } }

.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover;
  display: inline-grid; place-items: center; background: var(--surface);
  font-weight: 800; color: var(--muted); text-transform: uppercase;
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.avatar.ring { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--live); }

.skeleton .thumb, .skeleton .card-body span, .channel-hero.skeleton {
  background: linear-gradient(90deg, var(--card) 0%, var(--surface) 50%, var(--card) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
}
.skeleton { cursor: default; }
.skeleton .card-body { flex-direction: column; gap: 8px; }
.skeleton .card-body span { display: block; height: 12px; border-radius: 6px; width: 85%; }
.skeleton .card-body span + span { width: 50%; }

.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; border-radius: var(--r-card);
  background: var(--card); border: 1px dashed var(--line-strong);
  color: var(--muted); text-align: center;
}
.login-card {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 24px; border-radius: 18px; text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, rgba(var(--primary-rgb), 0.22), transparent 60%), var(--card);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
}
.login-card p { max-width: 460px; color: #d3d3d9; }
.login-card.compact { flex-direction: row; justify-content: space-between; padding: 14px 18px; text-align: left; background: var(--card); }
.login-card.compact { flex-wrap: wrap; gap: 10px 14px; }
.login-card.compact p { margin: 0; font-size: 14px; flex: 1 1 220px; }
.login-card-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(var(--primary-rgb), 0.18); color: var(--purple); }

/* ── Recherche ─────────────────────────────────────────────────────────── */
.search {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: var(--r-card);
  background: var(--card); border: 1px solid var(--line-strong);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.18); }
.search input { flex: 1; min-width: 0; height: 40px; background: none; border: 0; outline: none; color: var(--text); font-size: 16px; }
.search input::placeholder { color: #75757e; }
.search-icon { display: grid; color: var(--muted); }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  padding: 6px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.suggest-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 8px; text-align: left; }
.suggest-row:hover, .suggest-row.active { background: var(--surface); }
.suggest-name { flex: 1; font-weight: 700; }

.recent { margin: 18px 0 6px; }
.recent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 5px 0 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line-strong);
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: border-color 0.15s;
}
.chip:hover { border-color: var(--primary); }
.chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.chip > .ic:first-child { margin-left: 4px; color: var(--muted); }
.chip button { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.chip button:hover { background: rgba(255, 79, 77, 0.15); color: var(--danger); }

/* ── Page streamer ─────────────────────────────────────────────────────── */
.channel-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center;
  margin: 22px 0 34px; padding: 22px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
}
.channel-hero.is-live { border-color: rgba(233, 25, 22, 0.35); background: radial-gradient(100% 140% at 0% 0%, rgba(233, 25, 22, 0.12), transparent 60%), var(--card); }
.channel-hero.skeleton { height: 170px; }
.hero-id { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; }
.hero-id h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.hero-live { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-width: 0; }
.hero-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.hero-badges .muted { display: inline-flex; align-items: center; gap: 5px; }
.hero-title { font-size: 16px; font-weight: 700; line-height: 1.35; }
.hero-game { display: flex; align-items: center; gap: 6px; color: var(--purple); font-weight: 600; font-size: 14px; }
.hero-thumb { width: 340px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.hero-thumb:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--live); }
.filter { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--line-strong); color: var(--muted); }
.filter:focus-within { border-color: var(--primary); }
.filter input { width: 180px; background: none; border: 0; outline: none; color: var(--text); font-size: 14px; }
.filter-count { margin: -6px 0 12px; font-size: 13px; }

/* ── Lien / ID ─────────────────────────────────────────────────────────── */
.link-card { max-width: 640px; margin: 6vh auto; padding: 34px 26px; border-radius: 20px; text-align: center; background: var(--card); border: 1px solid var(--line); }
.link-card-icon { width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: rgba(var(--primary-rgb), 0.15); color: var(--purple); }
.link-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.link-card > p { margin-bottom: 22px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Lecteur en surimpression
   ═══════════════════════════════════════════════════════════════════════════ */
.watch {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.watch.open { opacity: 1; transform: none; }
.watch-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  height: calc(var(--head-h) + var(--safe-t)); padding: var(--safe-t) 10px 0;
  border-bottom: 1px solid var(--line);
}
.watch-id { flex: 1; min-width: 0; }
.watch-id strong { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-sub { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.watch-sub > span { display: inline-flex; align-items: center; gap: 4px; }

.watch-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chat-w);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: 'video chat' 'info chat';
  background: var(--bg);
}
.watch.chat-hidden .watch-body { grid-template-columns: minmax(0, 1fr) 0; }
.watch.chat-hidden .watch-chat { display: none; }
.watch-video {
  grid-area: video; position: relative; width: 100%;
  aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--head-h) - var(--safe-t) - 110px);
  background: #000; overflow: hidden;
}
.watch-info {
  grid-area: info; min-height: 0; overflow: auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
}
.wi-text { min-width: 0; }
.wi-text h1 { font-size: 18px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.wi-text .hero-game { margin-top: 6px; }
.wi-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.watch-chat { grid-area: chat; min-height: 0; border-left: 1px solid var(--line); }

.watch-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #000; }
.watch-error {
  position: absolute; inset: 0; z-index: 3; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; background: #000; color: var(--muted); text-align: center;
}
.watch.error .watch-error { display: flex; }
.watch.error .watch-loading { display: none; }
.spinner, .p-spinner span {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16); border-top-color: var(--purple);
  animation: spin 0.8s linear infinite;
}

/* Plein écran : vidéo seule, chat posé par-dessus à droite. */
.watch-body:fullscreen { display: block; position: relative; background: #000; }
.watch-body:fullscreen .watch-video { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; height: 100%; }
.watch-body:fullscreen .watch-info { display: none; }
.watch-body:fullscreen .watch-chat {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 34vw); z-index: 6;
  border-left: 0;
}
.watch-body:fullscreen .chat { background: rgba(14, 14, 16, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.watch:not(.chat-hidden) .watch-body:fullscreen .p-bottom,
.watch:not(.chat-hidden) .watch-body:fullscreen .p-menu { margin-right: min(340px, 34vw); }
.watch:not(.chat-hidden) .watch-body:fullscreen .p-big { margin-left: calc(min(340px, 34vw) / -2); }
.watch-body:-webkit-full-screen { display: block; position: relative; background: #000; }
.watch-body:-webkit-full-screen .watch-video { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; height: 100%; }
.watch-body:-webkit-full-screen .watch-info { display: none; }
.watch-body:-webkit-full-screen .watch-chat { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 34vw); z-index: 6; border-left: 0; }
.watch-body:-webkit-full-screen .chat { background: rgba(14, 14, 16, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.watch:not(.chat-hidden) .watch-body:-webkit-full-screen .p-bottom,
.watch:not(.chat-hidden) .watch-body:-webkit-full-screen .p-menu { margin-right: min(340px, 34vw); }
.watch:not(.chat-hidden) .watch-body:-webkit-full-screen .p-big { margin-left: calc(min(340px, 34vw) / -2); }

/* Réduit : petite fenêtre flottante, la lecture continue. */
.watch-mini { display: none; align-items: center; gap: 2px; padding: 8px 6px 8px 12px; min-width: 0; }
.mini-text { flex: 1; min-width: 0; }
.mini-text strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-play .when-playing { display: none; }
.watch:has(.player:not(.paused)) .mini-play .when-paused { display: none; }
.watch:has(.player:not(.paused)) .mini-play .when-playing { display: grid; }
.mini-play > span { display: grid; }
.watch.minimized {
  inset: auto 20px 20px auto; width: 380px;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--card); border: 1px solid var(--line-strong);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  padding: 0;
}
.watch.minimized .watch-head, .watch.minimized .watch-info, .watch.minimized .watch-chat { display: none; }
.watch.minimized .watch-body { display: block; flex: none; }
.watch.minimized .watch-video { aspect-ratio: 16 / 9; max-height: none; cursor: pointer; }
.watch.minimized .p-ui, .watch.minimized .p-unmute, .watch.minimized .p-menu, .watch.minimized .p-flash { display: none; }
.watch.minimized .watch-mini { display: flex; }

/* ═══════════════════════════════════════════════════════════════════════════
   Lecteur vidéo
   ═══════════════════════════════════════════════════════════════════════════ */
.player { position: absolute; inset: 0; overflow: hidden; background: #000; outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player:not(.ui):not(.paused) { cursor: none; }
.p-ui { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.player.ui .p-ui, .player.paused .p-ui { opacity: 1; pointer-events: auto; }
.p-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent 38%), linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 22%); }
.p-big {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.15s;
}
.p-big:hover { background: var(--primary); transform: translate(-50%, -50%) scale(1.05); }
@media (pointer: fine) { .player:not(.paused) .p-big { display: none; } }
.player:has(.p-spinner:not([hidden])) .p-big { display: none; }

.p-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px 6px; }
.p-progress { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.p-track { position: relative; width: 100%; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.25); transition: height 0.15s; }
.p-progress:hover .p-track { height: 6px; }
.p-buffer, .p-played { position: absolute; top: 0; bottom: 0; left: 0; width: 0; }
.p-buffer { background: rgba(255, 255, 255, 0.35); }
.p-played { background: var(--primary); }
.p-knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.35); transform: translate(-50%, -50%) scale(0); transition: transform 0.15s; pointer-events: none; }
.p-progress:hover .p-knob { transform: translate(-50%, -50%) scale(1); }
@media (pointer: coarse) { .p-knob { transform: translate(-50%, -50%) scale(1); } }
.p-tip { position: absolute; bottom: 22px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.85); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
/* Au doigt, l'infobulle passe au-dessus du pouce, en plus grand : collée à
   la barre, le pouce la cachait et on visait l'instant à l'aveugle. */
@media (pointer: coarse) { .p-tip { bottom: 48px; padding: 6px 12px; font-size: 15px; } }
/* Pendant un glissement, le compteur affiche l'instant visé : il se détache. */
.player.scrubbing .p-time { color: var(--purple); }

.p-bar { display: flex; align-items: center; gap: 2px; height: 46px; color: #fff; }
.p-btn { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r-control); color: #fff; transition: background 0.15s, color 0.15s; }
.p-btn:hover { background: rgba(255, 255, 255, 0.14); }
.p-btn b { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -42%); font-size: 8px; font-weight: 800; }
.p-btn.on { color: var(--purple); }
.p-volume { display: flex; align-items: center; }
.p-vol { width: 0; opacity: 0; transition: width 0.2s, opacity 0.2s, margin 0.2s; accent-color: #fff; cursor: pointer; }
.p-volume:hover .p-vol, .p-vol:focus-visible { width: 84px; opacity: 1; margin-right: 8px; }
@media (pointer: coarse) { .p-vol { display: none; } }
.p-time { margin-left: 6px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-live { display: flex; align-items: center; gap: 6px; height: 26px; margin-left: 6px; padding: 0 10px; border-radius: 6px; background: var(--live); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.p-live.behind { background: rgba(255, 255, 255, 0.18); }
.p-live.behind .dot { background: var(--live); }
.p-latency { margin-left: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.p-latency:hover { color: #fff; }
.p-spacer { flex: 1; }
.p-quality { width: auto; gap: 4px; padding: 0 8px; display: flex; }
.p-q-label, .p-q-speed { font-size: 12px; font-weight: 800; white-space: nowrap; }
.p-q-speed:empty { display: none; }
.p-q-label:not(:empty) + .p-q-speed::before { content: '· '; }
.player[data-kind='live'] .vod-only, .player[data-kind='vod'] .live-only { display: none; }

.p-menu {
  position: absolute; right: 12px; bottom: 62px; z-index: 5;
  min-width: 210px; max-height: calc(100% - 80px); overflow: auto;
  padding: 6px; border-radius: 12px;
  background: rgba(24, 24, 27, 0.96); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: pop 0.14s ease;
}
.p-menu > button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.p-menu > button:hover { background: var(--surface); }
.p-menu > button.on { color: var(--purple); }
.p-menu > button.p-menu-report { justify-content: flex-start; gap: 8px; margin-top: 4px; color: var(--muted); font-weight: 500; }
.p-menu > button.p-menu-report:hover { color: var(--text); }
.p-menu-title { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.p-speeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 4px 4px; }
.p-speeds button { padding: 8px 0; border-radius: 8px; background: var(--surface); font-weight: 700; font-size: 13px; }
.p-speeds button.on { background: var(--primary); color: var(--on-primary); }
.p-spinner { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.p-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-weight: 800; font-size: 18px; opacity: 0; pointer-events: none; }
.p-flash.show { animation: flash 0.7s ease-out; }
.p-unmute { position: absolute; top: 12px; left: 12px; z-index: 4; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.72); color: #fff; font-weight: 700; font-size: 13px; }
.p-unmute:hover { background: var(--primary); }
/* Passage au son coupé par Twitch : avis, et repères orange sur la barre. */
.p-mutednote { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); padding: 4px 4px 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 176, 32, 0.55); color: #fff; font-size: 12.5px; font-weight: 600; }
.p-mutednote[hidden] { display: none; }
.p-mutednote-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-mutednote-skip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 700; font-size: 12px; }
.p-mutednote-skip:hover { background: var(--primary); }
.watch.minimized .p-mutednote { display: none; }
.p-mutedseg { position: absolute; top: 0; bottom: 0; background: rgba(255, 176, 32, 0.85); pointer-events: none; }
/* Pause pub de la chaîne : ce qui se passe, et quand le direct revient.
   Toujours sur fond sombre (par-dessus l'image), quel que soit le thème. */
.p-adbreak { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; gap: 3px; width: max-content; max-width: min(440px, calc(100% - 24px)); padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.78); border: 1px solid var(--primary); color: #fff; font-size: 12.5px; line-height: 1.35; pointer-events: none; }
.p-adbreak[hidden] { display: none; }
.p-adbreak-title { font-size: 14px; font-weight: 800; }
.p-adbreak-sub { font-variant-numeric: tabular-nums; }
.p-adbreak-hint { color: rgba(255, 255, 255, 0.7); font-size: 11.5px; }
/* « Activer le son » en haut à gauche : le bandeau passe dessous. */
.p-unmute:not([hidden]) ~ .p-adbreak { top: 56px; }
.watch.minimized .p-adbreak { display: none; }
@media (max-width: 520px) { .p-adbreak-hint { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Chat
   ═══════════════════════════════════════════════════════════════════════════ */
.chat { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--card); font-size: var(--chat-size, 14px); }
.chat-head { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); }
.chat-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.chat-status { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status[data-state='disconnected'] { color: var(--danger); }
/* Message épinglé : bandeau compact d'une ligne, déplié au chevron. */
.chat-pinned {
  position: relative; flex: none; overflow: hidden;
  background: var(--card-hi); border-bottom: 1px solid var(--line);
}
.pin-panel { position: relative; padding: 6px 6px 6px 10px; background: var(--card-hi); }
/* Drops de la chaîne : carte à fermer sous l'épinglé. */
.chat-drops { flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px 8px 12px; background: var(--card-hi); border-bottom: 1px solid var(--line); }
.chat-drops[hidden] { display: none; }
.chat-drops > img, .chat-drops .drops-ic { flex: none; width: 34px; height: 34px; object-fit: contain; display: grid; place-items: center; color: var(--purple); }
.chat-drops .drops-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-drops strong { font-size: 13px; line-height: 1.3; }
.chat-drops .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-drops .drops-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); }
.chat-drops .drops-meta a { color: var(--purple); font-weight: 700; }
/* Emotes et badges : un clic ouvre leur fiche. */
.chat-list img.emote, .chat-list img.badge, .chat-pinned img.emote, .chat-pinned img.badge,
.user-card img.emote, .user-card img.badge { cursor: pointer; }
/* Appui long sur une emote : sa fiche (view.js, pressForInfo), pas le menu
   d'image de Safari sur iPhone et iPad. */
.chat-list img.emote, .chat-pinned img.emote, .user-card img.emote { -webkit-touch-callout: none; }
.chat-info .ci-hide { margin-top: 2px; }
/* Plus haute qu'avant (chaîne, autres emotes) : elle défile dans un petit
   chat, comme celui du multi-live, au lieu d'en déborder. */
.chat-info {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--composer-h, 58px) + 12px); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 16px 16px;
  max-height: calc(100% - var(--composer-h, 58px) - 32px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); text-align: center;
}
.chat-info > * { flex-shrink: 0; }
.chat-info[hidden] { display: none; }
.chat-info .ci-twitch { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 100%; }
.chat-info .ci-twitch:empty { display: none; }
.chat-info .ci-owner {
  display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 10px 6px 6px;
  border-radius: 999px; background: var(--card-hi); color: var(--text); font-size: 13px;
}
.chat-info .ci-owner:hover { background: var(--surface-hi); }
.chat-info .ci-owner img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.chat-info .ci-owner strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-info .ci-owner .pill { flex-shrink: 0; }
.chat-info .ci-owner-go { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; color: var(--purple); font-size: 12px; font-weight: 700; }
.chat-info .ci-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.chat-info .ci-more img { height: 28px; max-width: 56px; object-fit: contain; }
.chat-info .ci-link { display: inline-flex; align-items: center; gap: 4px; color: var(--purple); font-size: 12px; font-weight: 700; }
.chat-info .ci-close { position: absolute; top: 6px; right: 6px; }
.chat-info .ci-img { height: 64px; max-width: 100%; object-fit: contain; }
.chat-info .ci-badge { height: 44px; }
.chat-info .ci-name { font: 700 18px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: all; word-break: break-all; }
.chat-info .ci-title { font-size: 16px; }
.chat-info .ci-src { margin: 0; font-size: 12px; color: var(--muted); }
.chat-info .ci-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
/* Déplié : par-dessus la liste, sans la pousser. */
.chat-pinned.open { overflow: visible; z-index: 6; }
.chat-pinned.open .pin-panel { position: absolute; top: 0; left: 0; right: 0; border-bottom: 1px solid var(--line-strong); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); }
.chat-pinned.can-open { cursor: pointer; }
.pin-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pin-ic { flex: none; display: inline-flex; color: var(--purple); }
.pin-body { flex: 1; min-width: 0; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pinned.open .pin-body { white-space: normal; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.chat-pinned.open .pin-row { align-items: flex-start; }
.pin-body .emote { vertical-align: middle; }
.pin-sender { font-weight: 700; }
.pin-colon { margin-right: 2px; color: var(--text); }
.pin-body a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.pin-row .icon-btn { flex: none; color: var(--muted); }
.pin-toggle svg { transition: transform 0.2s ease; }
.chat-pinned.open .pin-toggle svg { transform: rotate(180deg); }
.pin-meta { margin: 1px 0 0 20px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(var(--primary-rgb), 0.15); }
.pin-progress i { display: block; height: 100%; background: var(--purple); transform-origin: left center; }
/* Réduit : pastille dans l'en-tête du chat. Flottante en haut de la liste,
   elle couvrait la croix des drops, du raid ou de la prédiction. */
.pin-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid rgba(var(--primary-rgb), 0.4);
  background: var(--card-hi); color: var(--purple); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.pin-chip:hover { background: var(--card); }
/* Chat synchronisé : retard appliqué (« ⏱ −6 s »), barré quand la synchro
   est coupée ; un clic coupe ou rallume. */
.chat-sync {
  flex: none; height: 24px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line);
  background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.chat-sync:hover { background: var(--card); color: var(--text); }
.chat-sync.off { opacity: 0.6; text-decoration: line-through; }
.lang-hint { margin-top: 8px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; overscroll-behavior: contain; scrollbar-width: thin; }

.msg { padding: 3px 12px; line-height: 1.6; overflow-wrap: anywhere; cursor: pointer; }
.msg:hover { background: rgba(255, 255, 255, 0.04); }
.msg-time { display: none; margin-right: 6px; color: var(--muted); font-size: 0.8em; font-variant-numeric: tabular-nums; }
.chat.show-time .msg-time, .uc-msg .msg-time { display: inline; }
.badge { width: 18px; height: 18px; margin-right: 3px; vertical-align: -3px; border-radius: 3px; display: inline-block; }
.msg-name { padding: 0; font-weight: 700; vertical-align: baseline; }
.msg-name:hover { text-decoration: underline; }
.msg-colon { color: var(--text); }
.emote { display: inline-block; height: 2em; max-width: 7em; margin: -0.35em 0; vertical-align: middle; object-fit: contain; }
/* GIF du clavier GIF de Twitch : sur sa propre ligne, taille bornée. */
.chat-gif { display: block; width: auto; height: auto; max-width: min(100%, 260px); max-height: 160px; margin: 4px 0 2px; border-radius: 8px; }
.mention { padding: 0 3px; border-radius: 4px; font-weight: 700; background: rgba(255, 255, 255, 0.08); }
.mention.self { background: rgba(var(--primary-rgb), 0.4); color: #fff; }
.msg a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.msg.me { background: rgba(var(--primary-rgb), 0.14); box-shadow: inset 3px 0 var(--primary); }
.msg.hl { background: rgba(var(--purple-rgb), 0.1); box-shadow: inset 3px 0 var(--purple); }
.msg.first { box-shadow: inset 3px 0 var(--success); }
.msg.old { opacity: 0.6; }
.msg.deleted .msg-body { text-decoration: line-through; opacity: 0.45; }
.msg.sys { padding: 6px 16px; color: var(--muted); font-size: 0.88em; font-style: italic; text-align: center; cursor: default; }
.msg.sys:hover { background: none; }
.msg-reply { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.82em; }
.msg-reply span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-sep { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.msg-sep::before, .msg-sep::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }

.chat-resume {
  position: absolute; left: 50%; bottom: calc(var(--composer-h, 58px) + 16px); z-index: 3; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 13px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.chat-resume:hover { background: var(--primary-hi); }
.chat:not(:has(.chat-composer:not([hidden]))) .chat-resume { bottom: 16px; }
.chat-empty { position: absolute; top: 44px; left: 0; right: 0; padding: 40px 20px; color: var(--muted); text-align: center; pointer-events: none; }
/* Chat d'une chaîne hors ligne (openOffline) : ses commandes de bots. */
.chat-empty .btn { margin-top: 14px; pointer-events: auto; }

.chat-composer { position: relative; flex: none; padding: 10px 10px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); }
.chat-input-row { display: flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border-radius: var(--r-control); background: var(--surface); border: 1px solid transparent; transition: border-color 0.15s; }
.chat-input-row:focus-within { border-color: var(--primary); }
.chat-input { flex: 1; min-width: 0; height: 36px; background: none; border: 0; outline: none; color: var(--text); font-size: 15px; }
.chat-input::placeholder { color: #75757e; }
@media (pointer: coarse) { .chat-input { font-size: 16px; } }
.chat-send:not(:disabled) { color: var(--purple); }
.chat-login { width: 100%; height: 42px; border-radius: var(--r-control); background: var(--surface); font-weight: 700; font-size: 14px; transition: background 0.15s; }
.chat-login:hover { background: var(--primary); }
.chat-replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 6px 4px; font-size: 12px; color: var(--muted); }

.chat-suggest, .emote-picker {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% - 4px); z-index: 4;
  border-radius: 12px; background: var(--card-hi); border: 1px solid var(--line-strong);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); animation: pop 0.14s ease;
}
.chat-suggest { padding: 4px; max-height: 280px; overflow: auto; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; font-weight: 600; font-size: 14px; text-align: left; }
.suggest-item img { height: 26px; max-width: 40px; object-fit: contain; }
.suggest-item .dot { width: 10px; height: 10px; border-radius: 50%; margin: 0 8px; }
.suggest-item:hover, .suggest-item.active { background: rgba(var(--primary-rgb), 0.25); }
.suggest-key { margin-left: auto; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 18px; }
@media (hover: none), (pointer: coarse) { .suggest-key { display: none; } }
.emote-picker { height: min(340px, 48vh); display: flex; flex-direction: column; overflow: hidden; }
.emote-picker-head { padding: 8px; }
.emote-search { width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); outline: none; color: var(--text); font-size: 14px; }
.emote-search:focus { border-color: var(--primary); }
.emote-grid { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.emote-section { position: sticky; top: 0; z-index: 1; padding: 8px 2px 4px; background: var(--card-hi); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
/* Onglets du sélecteur (« Mes emotes », la chaîne, les globales) ; avatar
   de la chaîne devant son nom dans « Mes emotes ». */
.emote-tabs { margin-top: 6px; }
.emote-tabs button { white-space: nowrap; }
.emote-section img { width: 16px; height: 16px; margin: -2px 6px 0 0; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.emote-grid > .emote-cells:first-child { padding-top: 6px; }
.emote-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; }
.emote-cells button { height: 42px; border-radius: 8px; display: grid; place-items: center; }
.emote-cells button:hover { background: rgba(255, 255, 255, 0.08); }
.emote-cells img { max-height: 28px; max-width: 38px; object-fit: contain; }
/* Appui long (iPhone, iPad) : la fiche de l'emote, sans le menu d'image, la
   sélection ni le glisser de Safari, qui l'interrompaient (view.js). */
.emote-cells { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.emote-cells img { -webkit-user-drag: none; }

.bot-cmds {
  position: absolute; left: 8px; right: 8px; top: 46px; bottom: 8px; z-index: 7;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-card);
  background: var(--card-hi); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.65); animation: pop 0.16s ease;
}
.bot-cmds[hidden] { display: none; }
.bot-cmds-head { display: flex; align-items: center; gap: 8px; color: var(--purple); }
.bot-cmds-head b { flex: 1; color: var(--text); font-size: 14px; }
.bot-cmds-filter { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.bot-cmds-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.bot-cmds-list h4 { position: sticky; top: 0; display: flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 4px 0; font-size: 13px; background: var(--card-hi); }
.bot-cmds-list h4 img { width: 18px; height: 18px; border-radius: 50%; }
.bot-cmd { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.bot-cmd:hover { background: var(--surface); }
.bot-cmd code { color: var(--purple); font-weight: 700; font-size: 13px; }
.bot-cmd span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bot-cmd.copied code::after { content: ' ✓'; color: var(--success, #4ade80); }
.bot-cmd a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* Page d'une chaîne hors ligne : la même liste dans une feuille ; le filtre
   reste en haut, la liste défile. */
.bot-cmds-sheet { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.bot-cmds-sheet .bot-cmds-list { flex: none; max-height: min(520px, 60dvh); overscroll-behavior: contain; }
.bot-cmds-sheet .bot-cmds-list h4 { background: var(--card); }
.user-card {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 6;
  display: flex; flex-direction: column; max-height: 72%;
  padding: 12px; border-radius: var(--r-card);
  background: var(--card-hi); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.65); animation: pop 0.16s ease;
}
.user-card-head { display: flex; align-items: center; gap: 10px; }
.user-card-head .avatar { width: 42px; height: 42px; }
.user-card-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-card-id strong { font-size: 16px; }
.user-card-id .muted { font-size: 12px; }
.user-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.user-card-label { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.user-card-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.uc-msg.deleted { text-decoration: line-through; opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   Feuilles (réglages, ouvrir dans…)
   ═══════════════════════════════════════════════════════════════════════════ */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 50%; top: 50%; z-index: 81;
  width: min(480px, calc(100% - 32px)); max-height: min(740px, calc(100dvh - 48px)); overflow: auto;
  padding: 20px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translate(-50%, -47%) scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
}
.sheet.open { opacity: 1; transform: translate(-50%, -50%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-head h2 { font-size: 19px; font-weight: 800; }
.sheet-sub { font-size: 13px; margin-bottom: 8px; }
.sheet-section { padding: 16px 0; border-top: 1px solid var(--line); }
.sheet-head + .sheet-section { border-top: 0; padding-top: 8px; }
.sheet-section h3 { margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; cursor: pointer; }
.setting-text { display: flex; flex-direction: column; gap: 2px; }
.setting-text span { font-weight: 600; }
.setting-text small { font-size: 12px; color: var(--muted); line-height: 1.4; }
/* « Chaînes notifiées » : recherche, tout activer / couper, une case par chaîne. */
.push-ch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.push-ch-tools .text-input { flex: 1 1 160px; min-width: 0; }
.push-ch-list { max-height: 55vh; overflow-y: auto; }
.push-ch-who { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.push-ch-who img { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.push-ch-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--surface-hi); cursor: pointer; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.2s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }
.size-ctl { display: flex; align-items: center; gap: 10px; }
.size-ctl input { accent-color: var(--primary); width: 140px; }
.size-ctl output { width: 2ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.account-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.account-id { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.account-id small { font-size: 12px; line-height: 1.4; }
.sheet-group { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.sheet-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-control); background: var(--surface); font-weight: 600; text-align: left; transition: background 0.15s; }
.sheet-row:hover { background: var(--surface-hi); }
.sheet-row > span:nth-child(2) { flex: 1; }
.app-dot { width: 12px; height: 12px; border-radius: 4px; }
.app-dot.vlc { background: #ff8800; }
.app-dot.outplayer { background: #007aff; }
.app-dot.infuse { background: #fc3c44; }
.link-box { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: var(--r-control); background: var(--bg); border: 1px solid var(--line-strong); color: var(--purple); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; outline: none; }

/* ── Télécharger une VOD ───────────────────────────────────────────────── */
.dl-vod { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-block { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.dl-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.segmented.dl-q { flex-wrap: wrap; }
.segmented.dl-q button { padding: 6px 10px; }
.dl-wait { display: grid; place-items: center; padding: 24px 0; }
.dl-time { margin: 10px 0; }
.dl-time-head { display: flex; align-items: center; gap: 10px; }
.dl-time-head .dl-label { flex: 1; }
.dl-time-head button { padding: 4px 2px; font-size: 13px; font-weight: 700; color: var(--purple); }
.dl-time-head b { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.dl-time input[type='range'] { width: 100%; margin-top: 6px; accent-color: var(--primary); }
.dl-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.dl-summary { margin: 6px 0 4px; font-weight: 700; }
.dl-warn { margin: 8px 0; padding: 10px 12px; border-radius: var(--r-control); background: rgba(255, 79, 77, 0.1); color: var(--danger); font-size: 13px; line-height: 1.45; }
.dl-note { margin-top: 10px; line-height: 1.45; }
#dl-go { margin-top: 10px; }
.dl-bar { height: 8px; margin: 14px 0 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.dl-bar span { display: block; height: 100%; background: var(--primary); transition: width 0.2s; }
.dl-state { margin-bottom: 4px; font-weight: 700; }
#dl-progress .btn { margin-top: 14px; }

/* ── Multi-live ────────────────────────────────────────────────────────── */
/* « + » des cartes de live et de VOD : ajoute la vidéo à la mosaïque. */
.thumb .madd {
  position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.thumb .madd:hover, .thumb .madd.on { background: var(--primary); }
.thumb .madd.on, .card:hover .madd, .card:focus-within .madd { opacity: 1; }
@media (hover: none) { .thumb .madd { opacity: 1; } }
/* Cartes de VOD : en haut à droite, la durée occupe le bas. */
.vod-card .thumb .madd { top: 6px; bottom: auto; }
/* Épingle des chaînes suivies : à gauche du « + », visible une fois épinglée. */
.thumb .mpin {
  position: absolute; right: 42px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.thumb .mpin:hover, .thumb .mpin.on { background: var(--primary); }
.thumb .mpin.on, .card:hover .mpin, .card:focus-within .mpin { opacity: 1; }
@media (hover: none) { .thumb .mpin { opacity: 1; } }
/* Œil barré des cartes de découverte (top, lives d'une catégorie) : à la
   place de l'épingle, qui n'est que sur les chaînes suivies. */
.thumb .mhide {
  position: absolute; right: 42px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.thumb .mhide:hover { background: var(--primary); }
.card:hover .mhide, .card:focus-within .mhide { opacity: 1; }
@media (hover: none) { .thumb .mhide { opacity: 1; } }
/* « N masqués ici · Gérer » sous une liste ; « Masquée · Réafficher ». */
.hidden-foot { display: flex; justify-content: center; margin: 14px 0 0; }
.hidden-foot:empty, .hide-slot:empty { display: none; }
.hero-id:has(.hide-slot:not(:empty)) { flex-wrap: wrap; }
.suggest-hidden { display: inline-flex; color: var(--muted); }
.hidden-list-title { margin: 12px 0 8px; font-size: 13px; font-weight: 600; }
.hidden-chips { margin-bottom: 12px; }
.hidden-chips .chip { height: 32px; padding-left: 12px; font-size: 13px; cursor: default; }
.hidden-empty { margin-top: 8px; }
.offline-row .opin {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.offline-row .opin:hover { color: var(--text); background: var(--surface); }
.offline-row .opin.on { color: var(--primary); opacity: 1; }
.offline-row:hover .opin, .offline-row:focus-within .opin { opacity: 1; }
@media (hover: none) { .offline-row .opin { opacity: 1; } }
.hero-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-btns .btn.on { border-color: var(--purple); color: var(--purple); }

/* Barre du bas : ce qui est choisi, et « Regarder ». */
.multi-bar {
  position: fixed; left: 20px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 440px); min-width: 0;
  padding: 6px 6px 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
html.watching .multi-bar { display: none; }
html:has(#multi-bar:not([hidden])) .content { padding-bottom: 96px; }
.mb-icon { display: grid; color: var(--purple); }
.mb-count { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mb-list { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.mb-chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 3px 0 10px; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mb-chip button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.mb-chip button:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.multi-bar .btn.sm { flex: none; border-radius: 999px; }

/* Mosaïque : 1 à 4 directs, le son sur celui qui est entouré. */
html.multi-open { overflow: hidden; }
.multi {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; background: #000;
  padding: var(--safe-t) env(safe-area-inset-right, 0px) var(--safe-b) env(safe-area-inset-left, 0px);
}
.multi-head { flex: none; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.multi-logo { display: grid; color: var(--purple); }
.multi-head strong { font-weight: 800; white-space: nowrap; }
.multi-hint { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-add { display: flex; align-items: center; height: 36px; padding-left: 10px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--line-strong); }
.multi-add input { width: 150px; min-width: 0; background: none; border: 0; outline: none; font-size: 14px; }
.multi-body { flex: 1; min-height: 0; display: flex; }
.multi-grid { flex: 1; min-width: 0; min-height: 0; display: grid; gap: 4px; padding: 4px; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
/* Chat du direct qui a le son : à droite, sur grand écran seulement. */
.multi-chat { display: none; flex: none; width: var(--chat-w); min-height: 0; border-left: 1px solid var(--line); }
.multi.with-chat .multi-chat { display: flex; }
.multi-chat-btn.on { color: var(--purple); }
@media (max-width: 899px) { .multi.with-chat .multi-chat, .multi-chat-btn { display: none; } }
.multi-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi-grid.n3, .multi-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.multi-grid.n3 .mtile:first-child { grid-row: span 2; }
/* La première tuile est déjà en tête : rien à avancer. */
.multi-grid .mtile:first-child [data-mt="earlier"] { display: none; }
/* En hauteur (téléphone) : les uns sous les autres, plus grands qu'en 2 × 2. */
@media (orientation: portrait) {
  .multi-grid.n2, .multi-grid.n3, .multi-grid.n4 { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .multi-grid.n3 .mtile:first-child { grid-row: auto; }
  .multi-hint { display: none; }
  .multi-add { flex: 1; min-width: 0; }
  .multi-add input { flex: 1; width: auto; }
}
.mtile { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 6px; background: #000; cursor: pointer; }
.mtile::after { content: ''; position: absolute; inset: 0; z-index: 3; border: 2px solid transparent; border-radius: inherit; pointer-events: none; transition: border-color 0.15s; }
.mtile.audible::after { border-color: var(--primary); }
.mtile:fullscreen { border-radius: 0; }
.mtile:-webkit-full-screen { border-radius: 0; }
.mtile video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mt-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 16px 10px;
  background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
  font-size: 13px; font-weight: 700; color: #fff;
}
.mt-sound { display: grid; opacity: 0.85; }
.mt-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-gap { flex: 1; }
.mt-btns { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.mtile:hover .mt-btns, .mtile:focus-within .mt-btns { opacity: 1; }
@media (hover: none) { .mt-btns { opacity: 1; } }
.mt-btns .icon-btn { background: rgba(0, 0, 0, 0.55); }
.mt-state { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 12px; text-align: center; color: var(--muted); font-size: 14px; }
/* Tuile VOD : sur celle qui a le son, une barre du bas toujours visible
   (±10 s, lecture/pause, temps, position) ; sur les autres, un trait de
   progression et une icône quand elle est en pause. */
.mtile.vod { container-type: inline-size; }
.mt-top .pill.vod { flex: none; }
.mt-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 3px; background: rgba(255, 255, 255, 0.25); pointer-events: none; }
.mt-progress span { display: block; width: 0; height: 100%; background: var(--primary); }
.mt-paused {
  position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
  display: none; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff; pointer-events: none;
}
.mtile.paused:not(.audible) .mt-paused { display: grid; }
.mt-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: none; align-items: center; gap: 2px; padding: 16px 12px 4px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 12px; font-weight: 700; color: #fff; cursor: default;
}
.mtile.vod.audible .mt-bottom { display: flex; }
.mtile.vod.audible .mt-progress { display: none; }
.mt-bottom .icon-btn { color: #fff; }
.mt-bottom .icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.mt-time { flex: none; margin: 0 6px 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-seek { position: relative; flex: 1; min-width: 40px; height: 24px; cursor: pointer; touch-action: none; }
.mt-seek::before, .mt-seek span { content: ''; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; }
.mt-seek::before { right: 0; background: rgba(255, 255, 255, 0.3); }
.mt-seek span { width: 0; background: var(--primary); }
.mt-seek:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
/* Tuile étroite (2 × 2 à côté du chat, petit écran) : la durée totale, puis
   le temps, laissent la place à la barre. */
@container (max-width: 380px) { .mt-total { display: none; } }
@container (max-width: 240px) { .mt-time { display: none; } }
@media (max-width: 760px) {
  .multi-bar { left: 8px; right: 8px; bottom: calc(70px + var(--safe-b)); max-width: none; border-radius: 14px; }
  html:has(#watch.minimized:not([hidden])) .multi-bar { bottom: calc(160px + var(--safe-b)); }
  html:has(#multi-bar:not([hidden])) .content { padding-bottom: calc(150px + var(--safe-b)); }
  html:has(#multi-bar:not([hidden])) .toast { bottom: calc(130px + var(--safe-b)); }
}
@media (max-width: 420px) { .multi-head strong { display: none; } }

/* ── Notification ──────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
  background: #2a2a31; border: 1px solid var(--line-strong); color: #fff;
  font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Bandeau cliquable (réponse à un signalement) : comme un toast, avec une action. */
.notice {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 101;
  display: flex; align-items: center; gap: 10px; width: min(460px, calc(100% - 24px));
  padding: 10px 8px 10px 12px; border-radius: 14px;
  background: var(--card-hi); border: 1px solid var(--line-strong); color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.notice.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.notice-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--on-primary); background: var(--primary); }
.notice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-text b { font-size: 14px; }
.notice-text small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .notice { bottom: calc(74px + var(--safe-b)); }
  html:has(#multi-bar:not([hidden])) .notice { bottom: calc(130px + var(--safe-b)); }
  html:has(#watch.minimized:not([hidden])) :is(.toast, .notice) { bottom: calc(156px + var(--safe-b)); }
  html:has(#watch.minimized:not([hidden])):has(#multi-bar:not([hidden])) :is(.toast, .notice) { bottom: calc(220px + var(--safe-b)); }
}
.toast.error { border-color: rgba(255, 79, 77, 0.55); }
.toast.success { border-color: rgba(0, 200, 120, 0.55); }

/* ═══════════════════════════════════════════════════════════════════════════
   Adaptations
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1700px) { :root { --chat-w: 380px; } }

@media (max-width: 1100px) {
  :root { --chat-w: 320px; }
}

/* Tablette et téléphone : vidéo, infos, puis chat en dessous (comme l'app). */
@media (max-width: 900px) {
  :root { --head-h: 52px; }
  .watch-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: 'video' 'info' 'chat'; }
  .watch.chat-hidden .watch-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .watch-video { max-height: none; }
  .watch-chat { border-left: 0; border-top: 1px solid var(--line); }
  .watch-info { align-items: center; padding: 10px 12px; gap: 10px; }
  .wi-text h1 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wi-text .hero-game { margin-top: 2px; font-size: 12px; }
  .wi-actions { flex-wrap: nowrap; gap: 6px; }
  .wi-actions .btn { width: 36px; padding: 0; }
  .wi-actions .btn span { display: none; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .topbar-actions { margin-left: auto; }
  .tabbar { display: grid; }
  .topbar { padding: var(--safe-t) 16px 0; height: calc(58px + var(--safe-t)); }
  .content { padding: 18px 16px calc(96px + var(--safe-b)); }
  .block { margin-bottom: 30px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 12px; }
  .grid.vods { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .rail { grid-auto-columns: 230px; }
  .channel-hero { grid-template-columns: 1fr; padding: 16px; }
  .hero-thumb { width: 100%; }
  .hero-id h2 { font-size: 20px; }
  .avatar.lg { width: 60px; height: 60px; }
  .filter input { width: 120px; }
  .link-card { margin: 2vh auto; padding: 26px 18px; }
  .search .btn { padding: 0 14px; }
  .toast { bottom: calc(84px + var(--safe-b)); }
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%;
    max-height: calc(100dvh - 40px); border-radius: 20px 20px 0 0;
    padding-bottom: calc(20px + var(--safe-b));
    transform: translateY(100%);
  }
  .sheet.open { transform: none; }
  .watch.minimized {
    left: 8px; right: 8px; bottom: calc(70px + var(--safe-b)); width: auto;
    flex-direction: row; align-items: center;
  }
  .watch.minimized .watch-body { width: 132px; }
  .watch.minimized .watch-mini { flex: 1; }
}

@media (max-width: 520px) {
  .account-btn:not(.logged) span { display: none; }
  .account-btn:not(.logged) { width: 38px; padding: 0; justify-content: center; }
  .brand-name { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .p-latency, .p-q-label { display: none; }
  /* La vitesse d'une VOD reste visible, en pastille sur l'icône : le bouton
     garde sa largeur (la barre est déjà pleine sur téléphone). */
  .p-q-label:not(:empty) + .p-q-speed::before { content: none; }
  .p-q-speed { position: absolute; right: 0; bottom: 2px; padding: 1px 3px; border-radius: 6px; background: var(--primary); color: var(--on-primary); font-size: 9px; line-height: 1.1; }
  .p-bar { gap: 0; }
  .p-btn { width: 38px; }
  .p-time, .p-live { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 400px) { .p-back, .p-fwd { display: none; } }
/* Entre 761 et 1 100 px, la barre du haut débordait : les onglets gardent
   leur icône (texte lu par les lecteurs d'écran), le compte son logo. */
@media (min-width: 761px) and (max-width: 1100px) {
  .nav button { padding: 8px 12px; }
  .nav button span[data-i18n] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .account-btn:not(.logged) span { display: none; }
  .account-btn:not(.logged) { width: 38px; padding: 0; justify-content: center; }
}

/* Téléphone en paysage : vidéo à gauche, chat à droite, en-tête en surimpression. */
@media (orientation: landscape) and (max-height: 540px) {
  .watch-head {
    position: absolute; top: 0; left: 0; right: 0; z-index: 7;
    border: 0; padding-top: 0; height: var(--head-h);
    background: linear-gradient(rgba(0, 0, 0, 0.72), transparent);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .watch:has(.player.ui) .watch-head, .watch:has(.player.paused) .watch-head, .watch.error .watch-head { opacity: 1; pointer-events: auto; }
  .watch:not(.chat-hidden) .watch-head { right: 40%; }
  :root[data-bg="light"] .watch-head { --text: #efeff1; --muted: #adadb8; color: var(--text); }
  .watch-body { grid-template-columns: minmax(0, 1fr) 40%; grid-template-rows: minmax(0, 1fr); grid-template-areas: 'video chat'; }
  .watch.chat-hidden .watch-body { grid-template-columns: minmax(0, 1fr) 0; grid-template-rows: minmax(0, 1fr); }
  .watch-video { aspect-ratio: auto; height: 100%; max-height: none; }
  .watch-info { display: none; }
  .watch-chat { border-top: 0; border-left: 1px solid var(--line); }
  .watch.minimized .watch-video { height: auto; aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); } }

/* Crédits (réglages) et pied de page */
.credits-title { margin: 14px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.credits { line-height: 1.6; }
.credits a, .site-footer a { color: var(--purple); }
.credits a:hover, .site-footer a:hover { text-decoration: underline; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding: 8px 0 4px; font-size: 13px; color: var(--muted); text-align: center; }
.site-footer a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Utilisation (réglages) */
.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.usage-cell { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-control); background: var(--surface); }
.usage-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.usage-cell strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.usage-split { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Événements du chat : raid, hype train, prédiction ──────────────────── */
.chat-events:empty { display: none; }
.chat-events { flex: none; display: flex; flex-direction: column; }
.chat-raid {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.28), rgba(var(--primary-rgb), 0.1));
  border-bottom: 1px solid var(--line);
}
.raid-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--card); color: var(--purple); }
.raid-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.raid-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.raid-sub { font-size: 11px; color: var(--muted); }
.chat-raid .icon-btn { color: var(--muted); }
.chat-pred, .chat-tpoll { padding: 7px 10px 8px; background: var(--card-hi); border-bottom: 1px solid var(--line); cursor: pointer; }
.pred-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--purple); }
.pred-head b { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pred-state { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pred-body { display: none; margin-top: 6px; flex-direction: column; gap: 6px; }
:is(.chat-pred, .chat-tpoll).open .pred-body { display: flex; }
:is(.chat-pred, .chat-tpoll).open .pred-head b { white-space: normal; }
.pred-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.pred-label span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pred-label span:last-child { flex: none; color: var(--muted); font-size: 11px; }
.pred-row.win .pred-label span:first-child { color: var(--text); }
.pred-bar { height: 5px; margin-top: 3px; border-radius: 3px; background: var(--card); overflow: hidden; }
.pred-bar i { display: block; height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ── TwitchUnblock Connect (extension) : points, mises, sondages, raids ─── */
/* Solde des points de la chaîne dans l'en-tête du chat, série de visionnage,
   et le coffre à réclamer quand les coffres automatiques sont coupés. */
.cx-points { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.cx-bal {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; transition: color 0.2s, border-color 0.2s;
}
.cx-bal-ic { display: inline-flex; color: var(--purple); }
.cx-bal-ic img { width: 14px; height: 14px; object-fit: contain; }
.cx-bal.gain { border-color: var(--success); color: var(--success); }
.cx-streak { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-claim {
  display: inline-grid; place-items: center; width: 28px; height: 24px; border-radius: 12px;
  background: var(--success); color: #0e0e10; animation: cx-claim 1.6s ease-in-out infinite;
}
.cx-claim:hover { filter: brightness(1.1); }
@keyframes cx-claim { 50% { transform: scale(1.08); } }
.cx-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Pastille de l'en-tête de la carte : « Miser », ou la mise faite. */
.cx-tag {
  flex: none; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.2); color: var(--purple); font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
/* Mise : montant, boutons rapides, issue, puis confirmation. */
.pred-act { display: none; flex-direction: column; gap: 6px; margin-top: 8px; cursor: default; }
.chat-pred.open .pred-act:not(:empty) { display: flex; }
.cx-amount { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cx-amount .text-input { flex: 1 1 84px; min-width: 0; height: 30px; padding: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cx-chip {
  flex: none; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; transition: border-color 0.15s;
}
.cx-chip:hover:not(:disabled) { border-color: var(--purple); }
.cx-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-pick {
  flex: 1 1 110px; min-width: 0; min-height: 32px; padding: 4px 10px; border-radius: 8px; background: var(--c); color: #fff;
  font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: filter 0.15s;
}
.cx-pick.blue { --c: #387aff; }
.cx-pick.pink { --c: #f5009b; }
.cx-pick:hover:not(:disabled) { filter: brightness(1.12); }
.cx-line { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.cx-line.ok { color: var(--success); font-weight: 700; }
.cx-line.lost { color: var(--muted); font-weight: 700; }
.cx-err { font-size: 12px; line-height: 1.4; color: var(--danger); }
.cx-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cx-confirm span { flex: 1 1 150px; min-width: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cx-confirm .btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
/* Sondage Twitch : même allure que la prédiction, un bouton par choix. */
.tpoll-row { display: flex; align-items: center; gap: 8px; }
.tpoll-main { flex: 1; min-width: 0; }
/* Extension sans session Twitch : une ligne, à fermer. */
.cx-note { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; background: var(--card-hi); border-bottom: 1px solid var(--line); color: var(--purple); font-size: 12px; }
.cx-note a { flex: 1; min-width: 0; color: var(--text); font-weight: 600; }
.cx-note a:hover { text-decoration: underline; }
.cx-note .icon-btn { color: var(--muted); }
.raid-bonus { display: inline-flex; align-items: center; gap: 3px; color: var(--success); font-weight: 700; }
/* Le solde ouvre les récompenses de la chaîne (panneau des commandes). */
button.cx-bal { cursor: pointer; }
button.cx-bal:hover { border-color: var(--purple); background: var(--card); }
.cx-rw-bal { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bot-cmds-list.cx-rw-list { gap: 6px; }
.cx-reward {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px;
  background: var(--surface); color: var(--text); text-align: left; transition: background 0.15s;
}
.cx-reward:hover:not(:disabled) { background: var(--surface-hi); }
.cx-reward:disabled { opacity: 0.5; }
.cx-reward.static { padding: 0; background: none; }
.cx-reward-ic {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: var(--rc, rgba(var(--primary-rgb), 0.22)); color: #fff;
}
.cx-reward-ic img { width: 28px; height: 28px; object-fit: contain; }
.cx-reward-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-reward-text b { font-size: 13px; overflow-wrap: anywhere; }
.cx-reward-text small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.cx-reward-cost { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--purple); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cx-rw-confirm { display: flex; flex-direction: column; gap: 8px; }
.text-input.cx-rw-input { height: auto; min-height: 64px; padding: 8px 10px; line-height: 1.4; resize: vertical; }
.cx-rw-count { align-self: flex-end; margin-top: -4px; font-size: 11px; font-variant-numeric: tabular-nums; }
/* Drops : progression du compte dans la carte de la campagne. */
.drops-cx { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.drops-cx[hidden] { display: none; }
.drop-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-size: 12px; }
.drop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.drop-min { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.drop-ok { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--success); font-size: 11px; font-weight: 700; }
.cx-chip.drop-claim { height: 22px; padding: 0 8px; font-size: 11px; }
/* Réglages → TwitchUnblock Connect */
.cx-state { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.cx-state i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.cx-state[data-tone='on'] i { background: var(--success); }
.cx-state[data-tone='warn'] i { background: #e6b400; }
.cx-state[data-tone='wait'] i { animation: cx-wait 0.8s ease-in-out infinite alternate; }
@keyframes cx-wait { to { opacity: 0.3; } }
.cx-about { margin-top: 6px; line-height: 1.45; }
:root[data-bg="light"] :is(.cx-bal.gain, .cx-line.ok, .raid-bonus, .drop-ok) { color: #0b7a4c; }
@media (prefers-reduced-motion: reduce) { .cx-claim, .cx-state i { animation: none; } }
/* Hype train : approche (pastilles), départ, niveau en cours (barre), fin */
.chat-hype { padding: 7px 10px 8px; background: var(--card-hi); border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-hype:focus-visible { outline-offset: -2px; }
.hype-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--live); }
.hype-head b { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hype-tag { flex: none; padding: 1px 6px; border-radius: 999px; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.hype-count { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hype-body { display: flex; align-items: center; gap: 8px; margin-top: 5px; min-width: 0; }
.chat-hype.folded .hype-body { display: none; }
.hype-dots { flex: none; display: inline-flex; gap: 4px; }
.hype-dot { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--live); color: #fff; }
.hype-dot.on { background: var(--live); }
.hype-dot.go { animation: hype-go 0.6s ease-out; }
.hype-sub { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hype-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.hype-bar i { display: block; height: 100%; border-radius: 3px; background: var(--live); }
.hype-pct { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes hype-go { from { transform: scale(0.4); } 60% { transform: scale(1.25); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hype-dot.go { animation: none; } }

/* ── Fin du live ────────────────────────────────────────────────────────── */
.watch-ended {
  position: absolute; inset: 0; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 16px; text-align: center; background: rgba(10, 10, 12, 0.88); color: var(--text);
}
.watch.ended .watch-ended { display: flex; }
.ended-ic { color: var(--muted); }
.ended-title { margin: 0; font-size: 18px; font-weight: 800; }
.ended-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Raid entrant, abonnements, annonces */
.msg.notice-raid { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 4px 8px; padding: 8px 10px; border-radius: 8px; font-style: normal; color: var(--text); background: rgba(var(--primary-rgb), 0.16); }
.msg.notice-raid svg { color: var(--purple); flex: none; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.msg.notice-sub { color: var(--purple); }
.msg.msg-announce { margin: 4px 8px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--announce) 16%, transparent); box-shadow: inset 3px 0 var(--announce); }
.setting.setting-col { flex-direction: column; align-items: stretch; gap: 8px; }
.feedback-form { display: flex; flex-direction: column; gap: 10px; }
/* Retours v2 : captures, « Mes signalements », discussion. */
.fb-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.feedback-btn { position: relative; }
.feedback-btn .fb-dot { position: absolute; top: -5px; right: -5px; }
.feedback-card .fb-dot, .sheet-row .fb-dot { margin-left: auto; }
.sheet-head .fb-mine-btn { margin-left: auto; }
.sheet-head .fb-mine-btn .fb-dot { margin-left: 2px; }
.fb-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-photos:empty { display: none; }
.fb-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.7); color: #fff; }
.feedback-form .fb-attach { align-self: flex-start; cursor: pointer; }
.fb-attach[hidden] { display: none; }
.fb-mine { display: flex; flex-direction: column; gap: 8px; }
.fb-mine-row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--line); text-align: left; color: var(--text); }
.fb-mine-row:hover { background: var(--surface); }
.fb-mine-row.unread { border-color: rgba(var(--purple-rgb), 0.5); }
.fb-mine-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-mine-top .muted { margin-left: auto; }
.fb-mine-text { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-kind { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface); color: var(--muted); vertical-align: middle; }
.fb-kind.bug { background: rgba(255, 79, 77, 0.14); color: #fca5a5; }
.fb-kind.idea { background: rgba(var(--primary-rgb), 0.18); color: var(--purple); }
.fb-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface); color: var(--muted); vertical-align: middle; }
.fb-status.accepted { background: rgba(57, 135, 229, 0.18); color: #93c5fd; }
.fb-status.progress { background: rgba(230, 230, 25, 0.14); color: #fde68a; }
.fb-status.done { background: rgba(0, 200, 120, 0.16); color: #86efac; }
.fb-status.refused { background: rgba(255, 79, 77, 0.14); color: #fca5a5; }
.fb-status.seen { background: rgba(var(--primary-rgb), 0.16); color: var(--purple); }
.sheet-head h2 .fb-kind, .sheet-head h2 .fb-status { font-size: 12px; }
.fb-chat { display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 460px); overflow-y: auto; padding: 2px 2px 8px; }
.fb-bubble { max-width: 85%; align-self: flex-start; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-bubble.mine { align-self: flex-end; background: rgba(var(--primary-rgb), 0.2); border-color: rgba(var(--primary-rgb), 0.35); }
.fb-bubble small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); white-space: normal; }
.fb-event { align-self: center; font-size: 12px; color: var(--muted); }
.fb-pics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fb-pics img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; display: block; background: var(--surface); }
.fb-reply-form { margin-top: 10px; }
.fb-locked { margin: 10px 2px 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.fb-reply-form textarea.text-input { min-height: 64px; }
.fb-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.switch-account { margin-top: 8px; }
.switch-account .setting-text small { display: block; }
.lang-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; padding: 10px 12px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.lang-ai > span { flex: 1 1 220px; }
.lang-ai .ic { color: var(--purple); flex: none; }
.feedback-form textarea.text-input { height: auto; min-height: 130px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.feedback-form .fb-info { color: var(--text); opacity: 0.75; overflow-wrap: anywhere; }
.feedback-form .btn.primary { align-self: stretch; justify-content: center; }
.text-input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
.text-input:focus { outline: 2px solid var(--purple); outline-offset: -1px; }

/* Clips */
.segmented.sm button { padding: 4px 10px; font-size: 12px; }
.thumb > .pill.views { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; }

/* Mode théâtre (écrans larges) : la vidéo occupe toute la hauteur. */
@media (min-width: 901px) {
  .watch.theatre .watch-body { grid-template-rows: minmax(0, 1fr) 0; }
  .watch.theatre .watch-info { display: none; }
  .watch.theatre .watch-video { aspect-ratio: auto; max-height: none; height: 100%; }
}
@media (max-width: 899px) { .p-theatre { display: none; } }
.watch.theatre .player .p-btn.p-theatre { color: var(--purple); }

/* Chapitres de VOD */
.p-chap { position: absolute; top: 50%; width: 2px; height: 8px; margin-left: -1px; transform: translateY(-50%); background: rgba(255, 255, 255, 0.85); border-radius: 1px; pointer-events: none; z-index: 1; }
.p-tip { white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }

/* Onglet « À propos » d'une chaîne : description, réseaux, panneaux. */
.about-card { padding: 18px 20px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--line); }
.about-card h3 { margin-bottom: 6px; font-size: 18px; font-weight: 800; }
.about-followers { margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.about-followers b { color: var(--text); }
.about-desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.about-desc a, .panel-text a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.about-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.about-socials a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.about-socials a:hover { background: var(--surface-hi); }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; margin-top: 18px; }
.panel { min-width: 0; }
.panel img { display: block; width: 100%; height: auto; border-radius: 10px; }
.panel h4 { margin: 8px 0 4px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.panel-text { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.panel-text .panel-h { color: var(--text); }

/* Planning d'une chaîne (onglet « Planning ») et sa ligne « Prochain live »
   sur une chaîne hors ligne. Annulé : barré, comme dans l'app. */
.hero-next { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: var(--purple); font-size: 13px; font-weight: 600; text-align: left; }
.hero-next:hover { text-decoration: underline; text-underline-offset: 2px; }
.hero-next .ic { flex: none; }
.sched-vacation { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 12px 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.sched-vacation .ic { flex: none; color: var(--purple); }
.sched-list { margin: 0; padding: 0; list-style: none; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.sched-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px; }
.sched-row + .sched-row { border-top: 1px solid var(--line); }
.sched-date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 46px; height: 50px; border-radius: var(--r-control); background: var(--surface); }
.sched-date span { color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.sched-date b { font-size: 19px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sched-body { min-width: 0; }
.sched-title { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.sched-when { margin-top: 2px; font-size: 13px; }
.sched-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sched-meta .hero-game { font-size: 13px; }
.sched-meta .pill { background: var(--surface); color: var(--muted); }
.sched-meta .pill.sched-canceled { background: rgba(255, 79, 77, 0.14); color: var(--danger); }
.sched-row.canceled .sched-title, .sched-row.canceled .sched-when { text-decoration: line-through; opacity: 0.7; }
.sched-hint { display: flex; align-items: center; gap: 6px; margin-top: 10px; }

/* Feuille « Partager » : chaque lien sous son nom. */
.share-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-row small { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.share-row > .ic:last-child { flex: none; color: var(--muted); }

/* VOD non listée (supprimée ou masquée) : rangée parmi les VODs, même
   carte, sans vignette (Twitch n'en sert plus). */
.unlisted-hint { display: flex; align-items: center; gap: 6px; margin: -4px 2px 12px; }
.unlisted-hint .ic { color: var(--purple); }
.vod-card.unlisted .thumb { display: grid; place-items: center; background: linear-gradient(var(--surface), var(--card)); }
.unlisted-ic { display: grid; color: var(--muted); }
.thumb > .pill.unlisted-pill { top: 8px; left: 8px; background: var(--primary); color: var(--on-primary); }
.vod-card.unlisted.busy { cursor: progress; opacity: 0.75; }
.vod-card.unlisted.gone { opacity: 0.55; }
.vod-card.unlisted.gone .unlisted-pill { background: var(--danger); }

/* Pied de page toujours en bas : la page fait au moins la hauteur de
   l'écran, et le pied est repoussé sous le contenu. */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.app > .content { flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; }
.app > .content > .site-footer { margin-top: auto; padding-top: 32px; }

/* Sélecteur de chapitres (VOD) */
.p-btn.p-chapters { display: inline-flex; flex-direction: row; align-items: center; height: 36px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); width: auto; max-width: 240px; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 700; }
.p-chap-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .p-btn.p-chapters { max-width: 130px; } }
.p-menu[data-kind='chapters'] { max-height: min(60vh, 420px, calc(100% - 80px)); overflow-y: auto; width: min(360px, 90vw); }
.p-chap-row { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.p-chap-row b { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.p-menu[data-kind='chapters'] { left: 12px; right: auto; }
.p-btn.p-chapters[hidden] { display: none !important; }

/* Nouveautés et journal des modifications */
.whats-new h3 { color: var(--purple); }
.whats-new h3 small { margin-left: 8px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.whats-new ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 14px; line-height: 1.45; }

/* Visite guidée : un voile percé autour du vrai bouton montré (l'ombre
   géante du trou), et une bulle à côté. */
html.touring { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 200vmax rgba(0, 0, 0, 0.74);
  transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}
.tour.no-hole .tour-hole { box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.74); }
/* Étape « appuie dessus » : une onde invite à toucher le bouton. */
.tour.tap .tour-hole::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--primary); animation: tour-pulse 1.3s ease-out infinite; }
@keyframes tour-pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.25); opacity: 0; } }
.tour-pop {
  position: fixed; width: min(360px, calc(100vw - 24px)); padding: 16px;
  border-radius: 16px; background: var(--card); border: 1px solid rgba(var(--purple-rgb), 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: top 0.35s ease, left 0.35s ease;
}
.tour-pop > p { font-size: 14px; line-height: 1.5; }
.tour-pop.card { width: min(420px, calc(100vw - 32px)); padding: 26px 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.tour-pop.card h2 { font-size: 22px; font-weight: 800; }
.tour-pop.card > p { color: var(--muted); font-size: 15px; }
.tour-badge { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--purple)); box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.45); }
.tour-langs { width: 100%; }
.tour-langs button { flex: 1 1 0; min-width: 0; padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tour-head strong { flex: 1; min-width: 0; font-size: 16px; }
.tour-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--purple)); }
.tour-pop > .tour-tap { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--purple); font-size: 13px; font-weight: 700; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-actions .link-btn { margin-right: auto; color: var(--muted); }
.tour-tips { list-style: none; display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 14px; border-radius: 12px; background: var(--surface); text-align: left; }
.tour-tips li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
.tour-tips .ic { margin-top: 1px; color: var(--purple); }
@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-pop { transition: none; }
  .tour.tap .tour-hole::after { animation: none; }
}

/* Pseudo du lecteur : ouvre la page de la chaîne. */
#watch-title.linkish, #watch-avatar.linkish { cursor: pointer; }
#watch-title.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Accueil : sous-onglets Suivies | Top | Hors ligne */
.home-tabs { margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.home-tabs button { padding: 7px 16px; white-space: nowrap; }
@media (max-width: 520px) { .home-tabs button { padding: 7px 12px; } }
#offline-count { font-size: 14px; font-weight: 600; }
.channel-tabs { margin: 4px 0 18px; max-width: 100%; overflow-x: auto; }
.channel-tabs button { padding: 7px 16px; white-space: nowrap; }
/* Chaînes suivies hors ligne */
.offline-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.offline-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.offline-row:hover { border-color: var(--purple); }
.offline-row img, .offline-row .avatar { flex: none; opacity: 0.8; }
.offline-text { display: flex; flex-direction: column; min-width: 0; }
.offline-text > span, .offline-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offline-text small { font-size: 12px; font-weight: 500; }
/* Catégories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; margin-top: 6px; }
.cat-card { cursor: pointer; min-width: 0; outline: none; }
.cat-box { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface); }
/* Œil barré d'une catégorie : en haut à droite ; allumé si elle est déjà
   masquée (résultats d'une recherche, carte atténuée). */
.cat-box .chide {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.cat-box .chide:hover, .cat-box .chide.on { background: var(--primary); }
.cat-card:hover .chide, .cat-card:focus-within .chide, .cat-box .chide.on { opacity: 1; }
@media (hover: none) { .cat-box .chide { opacity: 1; } }
.cat-card.is-hidden img, .cat-card.is-hidden h3, .cat-card.is-hidden .meta { opacity: 0.5; }
.cat-box img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.cat-card:hover .cat-box img, .cat-card:focus-visible .cat-box img { transform: scale(1.04); }
.cat-card h3 { margin: 8px 0 2px; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card .meta { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; color: var(--muted); }
.skeleton.cat .thumb { aspect-ratio: 3 / 4; }
.cat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.cat-head-box { width: 46px; height: 61px; border-radius: 8px; object-fit: cover; }
.cat-head .follow-local { margin-left: auto; }
.cat-lang { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px; border-radius: var(--r-control); background: var(--surface); color: var(--muted); }
.cat-lang select { height: 32px; max-width: 170px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cat-lang select option { background: var(--card); color: var(--text); }
.load-more { display: flex; justify-content: center; margin: 22px 0 0; }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; } }

/* Ordre des sources du direct (réglages → Lecteur) */
.src-order { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.src-order li { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 10px; border-radius: var(--r-control); background: var(--surface); }
.src-order .src-rank { flex: none; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(var(--primary-rgb), 0.2); color: var(--purple); }
.src-order .src-name { flex: 1; min-width: 0; font-size: 14px; }
.src-order .icon-btn[disabled] { opacity: 0.3; cursor: default; }
.src-reset { align-self: flex-start; margin-top: 8px; }

/* Réglages experts : Worker personnel */
.expert-row { display: flex; gap: 8px; margin-top: 8px; }
.expert-row .text-input { flex: 1; min-width: 0; }
.expert-reset { align-self: flex-start; margin-top: 6px; }
#worker-status:empty { display: none; }

/* Chat : modes du salon et règles à accepter */
.chat-modes { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 2px 6px; }
.chat-mode { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #fde68a; background: rgba(230, 230, 25, 0.12); }
/* Banni de ce chat : lu sans le compte, à la place du champ. */
.chat-banned { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 6px 6px 12px; border-radius: var(--r-control); font-size: 13px; font-weight: 600; color: #fde68a; background: rgba(230, 230, 25, 0.12); }
/* Colonne étroite (multi-live) : le bouton passe sous le texte. */
.chat-banned span { flex: 1 1 150px; min-width: 0; }
.chat-banned .btn { flex: none; max-width: 100%; color: inherit; }
.chat-rules { margin: 0 0 8px; padding: 12px; border-radius: var(--r-control); background: var(--card-hi); border: 1px solid var(--line-strong); font-size: 13px; max-height: 45vh; overflow-y: auto; }
.chat-rules b { display: block; margin-bottom: 6px; }
.chat-rules .rule { margin: 3px 0; white-space: pre-wrap; }
.chat-rules-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Journal des erreurs (Réglages → À propos). */
.errlog { margin: 10px 0; padding: 10px; max-height: 50vh; overflow: auto; border-radius: 10px; background: var(--surface); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; }

/* Champs en 16 px sur écran tactile : en dessous, Safari iOS zoomait la
   page à chaque toucher. */
@media (pointer: coarse) {
  .text-input, .emote-search, .bot-cmds-filter, .filter input, .multi-add input, .cat-lang select { font-size: 16px; }
  .cx-amount .text-input { font-size: 16px; height: 34px; }
}
