/* ============================================================
   FRANCETUBE — feuille de styles
   Interface vidéo responsive · thème sombre / clair
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --header-h: 56px;
  --sidebar-w: 240px;
  --rail-w: 76px;
  --radius: 12px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --accent: #2563eb;
  --accent-2: #3b82f6;
  --accent-soft: rgba(37, 99, 235, .16);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-soft: #161616;
  --surface: #212121;
  --surface-2: #2b2b2b;
  --hover: rgba(255, 255, 255, .08);
  --border: #2f2f2f;
  --text: #f1f1f1;
  --muted: #aaaaaa;
  --shadow: 0 16px 48px rgba(0, 0, 0, .65);
  --scrim: rgba(0, 0, 0, .6);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --surface: #f2f2f2;
  --surface-2: #e8e8e8;
  --hover: rgba(0, 0, 0, .06);
  --border: #e3e3e3;
  --text: #0f0f0f;
  --muted: #606060;
  --shadow: 0 16px 48px rgba(0, 0, 0, .18);
  --scrim: rgba(0, 0, 0, .45);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

img { max-width: 100%; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: top .2s;
}
.skip-link:focus { top: 10px; }

.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 300;
  padding: 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}

/* ---------- Boutons génériques ---------- */
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  transition: background .16s var(--ease);
  flex: none;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(.94); }

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--a1, #2563eb);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .22);
  user-select: none;
}
.avatar--sm { width: 32px; height: 32px; font-size: 16px; }
.avatar--xs { width: 24px; height: 24px; font-size: 13px; }
.avatar--channel {
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: none;
}
.avatar--channel.avatar--sm { font-size: 13px; }
.avatar--channel.avatar--xs { font-size: 11px; }
.avatar--user {
  width: 32px;
  height: 32px;
  border: 0;
  background: #ffffff;
  color: var(--accent);
  font-size: 17px;
  cursor: pointer;
}
.avatar--user:hover { box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-contrast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .16s, transform .16s;
}
.btn-contrast:hover { opacity: .82; }
.btn-contrast:active { transform: scale(.97); }
.btn-contrast.is-subscribed {
  background: var(--surface-2);
  color: var(--text);
}
.btn-contrast--sm { padding: 6px 12px; font-size: 12px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .16s;
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn i { font-size: 18px; }
.chip-btn--icon { padding: 8px 10px; }
.chip-btn.is-liked { background: var(--text); color: var(--bg); }
.chip-btn.is-disliked { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   EN-TÊTE
   ============================================================ */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
  opacity: .55;
}

.topbar__start {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 8px;
}
.brand__mark {
  width: auto;
  height: auto;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 24px;
  box-shadow: none;
  transition: transform .2s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.05); }
.brand__name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.7px;
}

/* ---------- Recherche ---------- */
.search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  min-width: 0;
}

.search__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-width: 0;
  padding: 0 8px 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  transition: border-color .18s var(--ease);
}
.search__field:focus-within {
  border-color: var(--accent);
}
.search__lead { font-size: 17px; color: var(--muted); flex: none; }
.search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}
.search__field input::placeholder { color: var(--muted); }
.search__field input::-webkit-search-cancel-button { display: none; }

.search__kbd {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.4;
}

.search__clear {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}
.search__clear:hover { background: var(--hover); }

.search__mic { flex: none; }

/* Suggestions */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 48px;
  z-index: 80;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: min(420px, 70vh);
  overflow-y: auto;
}
.suggestions:not([hidden]) { animation: suggestIn .16s var(--ease); }
@keyframes suggestIn {
  from { opacity: 0; transform: translateY(-4px); }
}
.suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.suggestion:hover, .suggestion.is-focus { background: var(--hover); }
.suggestion i { font-size: 17px; color: var(--muted); flex: none; }
.suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggestion small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.suggestion--query span { font-weight: 500; }

/* ---------- Droite de l'en-tête ---------- */
.topbar__end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-left: auto;
}

.create-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  margin-right: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  transition: background .16s;
}
.create-btn:hover { background: var(--surface-2); }
.create-btn i { font-size: 18px; }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--bg);
}

/* ============================================================
   MENU LATÉRAL
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  z-index: 55;
  width: var(--sidebar-w);
  padding: 12px 12px 28px;
  background: var(--bg);
  border-radius: 0 18px 18px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
  transition: width .22s var(--ease), transform .25s var(--ease);
}
.sidebar::-webkit-scrollbar { width: 8px; }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text);
  transition: background .14s;
}
.nav-item i { font-size: 22px; flex: none; }
.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item:hover { background: var(--hover); }
.nav-item.is-active {
  background: var(--accent-soft);
  font-weight: 600;
}
.nav-item.is-active i { color: var(--accent); }
.nav-item--channel { gap: 14px; }

.sidebar__hr {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: var(--border);
}

.sidebar__section { padding: 2px 0; }

.sidebar__title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.2px;
}
.sidebar__title i { font-size: 16px; color: var(--muted); }

.sidebar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 4px 12px 10px;
}
.sidebar__links a {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.sidebar__links a:hover { color: var(--text); }

.sidebar__copy {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  opacity: .8;
}

/* --- Mode mini (desktop uniquement) --- */
@media (min-width: 1024px) {
  body.is-mini .sidebar {
    width: var(--rail-w);
    padding: 12px 6px 28px;
    overflow: hidden;
  }
  body.is-mini .sidebar__hr,
  body.is-mini .sidebar__section,
  body.is-mini .sidebar__footer { display: none; }
  body.is-mini .nav-item {
    flex-direction: column;
    gap: 6px;
    padding: 14px 2px;
    font-size: 10px;
    text-align: center;
  }
  body.is-mini .nav-item span {
    font-size: 10px;
    max-width: 100%;
  }
  body.is-mini .nav-item i { font-size: 23px; }
  body.is-mini .main { margin-left: var(--rail-w); }
}

/* ============================================================
   ZONE PRINCIPALE
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--header-h) + 14px) 24px 72px;
  min-height: 100vh;
  transition: margin-left .22s var(--ease);
}

/* ---------- Filtres (chips) ---------- */
.chips {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  gap: 10px;
  margin: -4px 0 10px;
  padding: 10px 0 12px;
  overflow-x: auto;
  background: var(--bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  position: relative;
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .16s, transform .12s;
}
.chip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: calc(100% - 28px);
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity .16s;
}
.chip:hover { color: var(--accent); }
.chip:active { transform: scale(.96); }
.chip.is-active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
}
.chip.is-active::after { opacity: 1; }

/* ---------- Résultats ---------- */
.results {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 6px 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.results h1 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.results p { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* ---------- Shorts ---------- */
.shelf { margin: 2px 0 32px; scroll-margin-top: calc(var(--header-h) + 64px); }

.shelf__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.shelf__head > i {
  font-size: 24px;
  color: var(--accent);
}
.shelf__head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }

.shelf__scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.shelf__scroll::-webkit-scrollbar { display: none; }

.short {
  flex: 0 0 172px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  color: inherit;
  text-align: left;
}
.short:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.short__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  isolation: isolate;
}
.short__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform .35s var(--ease);
}
.short:hover .short__thumb img { transform: scale(1.05); }

.short__views {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}
.short__views i { font-size: 10px; }

.short__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding: 0 2px;
  min-width: 0;
}
.short__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.short__channel {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Grille de vidéos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 30px 16px;
}

.card { min-width: 0; }

.card__link { display: block; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--c1, #333), var(--c2, #111));
  isolation: isolate;
}
.thumb__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .28);
  font-size: 62px;
  z-index: 0;
}
.thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.card:hover .thumb img { transform: scale(1.04); }

.thumb__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .2px;
}

.thumb__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 3px;
  background: rgba(255, 255, 255, .32);
}
.thumb__progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.card__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 10px;
  padding-top: 12px;
}
.card__meta { min-width: 0; }

.card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.1px;
}
.card__title:hover { color: var(--accent); }

.card__channel {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  transition: color .14s;
}
.card__channel:hover { color: var(--text); }
.card__channel i { font-size: 13px; }

.card__stats {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.card__more {
  width: 28px;
  height: 28px;
  margin-top: -4px;
  font-size: 18px;
  opacity: 0;
  transition: opacity .16s, background .16s;
}
.card:hover .card__more,
.card:focus-within .card__more { opacity: 1; }

/* Fond gris arrondi au survol — ordinateur uniquement */
@media (hover: hover) and (min-width: 769px) {
  .card {
    position: relative;
    z-index: 0;
  }
  .card::before {
    content: "";
    position: absolute;
    inset: -8px;
    z-index: -1;
    border-radius: 22px;
    background: transparent;
    transition: background .18s var(--ease);
    pointer-events: none;
  }
  .card:hover::before { background: var(--surface); }

  .short {
    flex-basis: 188px;
    padding: 8px;
    border-radius: 28px;
    transition: background .18s var(--ease);
  }
  .short:hover { background: var(--surface); }
}

/* ---------- État vide ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 72px 16px;
  text-align: center;
}
.empty__icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 34px;
}
.empty h2 { font-size: 20px; }
.empty p { color: var(--muted); font-size: 14px; }
.empty .btn-contrast { margin-top: 12px; }

/* ============================================================
   PAGE DE LECTURE
   ============================================================ */
.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 1750px;
  margin: 0 auto;
}
.watch__main { min-width: 0; }

/* ---------- Lecteur ---------- */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  user-select: none;
}
.player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: .92;
}
.player__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 45%, rgba(0, 0, 0, .28)),
    linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .72));
  pointer-events: none;
}

.player__big {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 28px;
  backdrop-filter: blur(10px);
  transition: opacity .2s, transform .2s, background .2s;
}
.player__big:hover {
  background: var(--accent);
  border-color: transparent;
  transform: translate(-50%, -50%) scale(1.06);
}
.player.is-playing .player__big {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
}
.player:hover .player__big { opacity: 1; pointer-events: auto; }
.player.is-playing:hover .player__big { transform: translate(-50%, -50%) scale(1); }

.player__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 26px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72));
  color: #fff;
}

.player__bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 14px;
  cursor: pointer;
}
.player__bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .3);
  transition: height .15s;
}
#playerFill {
  position: relative;
  z-index: 1;
  width: 0;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-soft);
  transition: height .15s;
}
.player__bar:hover::before,
.player__bar:hover #playerFill { height: 6px; }

.player__row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}
.player__btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 19px;
  transition: background .15s;
}
.player__btn:hover { background: rgba(255, 255, 255, .14); }
.player__time {
  margin-left: 8px;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.player__spacer { flex: 1; }

/* ---------- Infos vidéo ---------- */
.watch__title {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.35px;
}

.watch__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.watch__channel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.watch__channel .avatar { width: 40px; height: 40px; }
.watch__channel-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.watch__channel-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.watch__channel-name i { font-size: 14px; color: var(--muted); }
.watch__channel-info > span { color: var(--muted); font-size: 12px; }

.watch__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.like-group {
  display: flex;
  align-items: center;
  flex: none;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}
.like-group .chip-btn { background: transparent; border-radius: 0; }
.like-group .chip-btn:hover { background: var(--surface-2); }
.like-group .chip-btn.is-liked { background: var(--text); color: var(--bg); }
.like-group__sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex: none;
}

/* ---------- Description ---------- */
.description {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.55;
  transition: background .16s;
}
.description:hover { background: var(--surface-2); }
.description__stats { font-weight: 600; margin-bottom: 8px; }
.description__text {
  max-height: 70px;
  overflow: hidden;
  color: var(--text);
  transition: max-height .3s var(--ease);
}
.description__text p + p { margin-top: 10px; }
.description.is-expanded .description__text { max-height: 900px; }
.description__toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.description__toggle:hover { color: var(--accent); }

/* ---------- Commentaires ---------- */
.comments { margin-top: 30px; }
.comments__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.comments__head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }

.comment-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.comment-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  outline: 0;
  font-size: 14px;
  transition: border-color .16s;
}
.comment-input:focus { border-color: var(--text); }

.comment-list { display: flex; flex-direction: column; gap: 20px; }

.comment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
}
.comment__body { min-width: 0; }
.comment__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.comment__name { font-size: 13px; font-weight: 600; }
.comment__time { color: var(--muted); font-size: 12px; }
.comment__text {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.comment__actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.comment__actions button:hover { background: var(--hover); color: var(--text); }
.comment__actions i { font-size: 16px; }
.comment__actions button.is-liked { color: var(--accent); }
.comment__reply { font-weight: 600; }

/* ---------- Colonne recommandations ---------- */
.watch__side { min-width: 0; }
.watch__side-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}
.recs { display: flex; flex-direction: column; gap: 10px; }

.rec {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 10px;
  padding: 4px;
  margin: -4px;
  border-radius: 10px;
  transition: background .15s;
}
.rec:hover { background: var(--hover); }
.rec__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  isolation: isolate;
}
.rec__thumb .thumb__glyph { font-size: 34px; }
.rec__thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rec__thumb .thumb__duration { right: 5px; bottom: 5px; font-size: 11px; }
.rec__meta { min-width: 0; padding-top: 1px; }
.rec__meta h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.rec__meta p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1160px) {
  .watch { grid-template-columns: minmax(0, 1fr) 388px; align-items: start; }
  .watch__side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; padding-right: 4px; }
  .watch__side::-webkit-scrollbar { width: 6px; }
}

/* ============================================================
   NAV MOBILE
   ============================================================ */
.mobile-nav { display: none; }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.popover {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 12px;
  z-index: 90;
  width: min(380px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop .16s var(--ease);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
}

.popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.popover__head h2 { font-size: 15px; font-weight: 600; }
.popover__read {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.popover__read:hover { text-decoration: underline; }

.notif-list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.notif {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
}
.notif:hover { background: var(--hover); }
.notif__body { flex: 1; min-width: 0; }
.notif__body p { font-size: 13px; line-height: 1.45; }
.notif__body span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.notif__thumb { color: var(--muted); font-size: 20px; flex: none; }

/* ============================================================
   MODAL SHORTS
   ============================================================ */
.shorts-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(10px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }

.short-player {
  position: relative;
  height: min(86vh, 700px);
  aspect-ratio: 9 / 16;
  max-width: 94vw;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  isolation: isolate;
  animation: shortPop .24s var(--ease);
}
@keyframes shortPop {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
}
.short-player__media {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--c1), var(--c2));
}
.short-player__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.short-player__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, .82), transparent 46%);
}

.short-player__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 20px;
  backdrop-filter: blur(8px);
}
.short-player__close:hover { background: rgba(255, 255, 255, .2); }

.short-player__rail {
  position: absolute;
  right: 10px;
  bottom: 128px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sp-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.sp-action i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .12);
  font-size: 22px;
  backdrop-filter: blur(8px);
  transition: background .16s, color .16s, transform .16s;
}
.sp-action:hover i { background: rgba(255, 255, 255, .22); color: var(--accent-2); }
.sp-action:active i { transform: scale(.94); }
.sp-action.is-liked i {
  color: var(--accent-2);
  background: rgba(37, 99, 235, .32);
  border-color: rgba(96, 165, 250, .5);
}

.short-player__info {
  position: absolute;
  left: 16px;
  right: 64px;
  bottom: 18px;
  z-index: 3;
  color: #fff;
}
.short-player__channel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.short-player__channel strong { font-size: 13px; }
.short-player__channel .btn-contrast {
  margin-left: 4px;
  background: #fff;
  color: #0f0f0f;
}
.short-player__info p { font-size: 14px; line-height: 1.4; margin-bottom: 8px; }
.short-player__music {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: .85;
}
.short-player__music i { font-size: 13px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   VOILE (drawer mobile)
   ============================================================ */
.scrim {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 54;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.scrim.is-visible { opacity: 1; pointer-events: auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .create-btn span { display: none; }
  .create-btn { padding: 0 10px; }
}

@media (max-width: 1023px) {
  .sidebar {
    width: 272px;
    padding: 12px;
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: none;
    background: var(--bg);
    transition: transform .25s var(--ease), visibility .25s;
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .35);
  }
  body.drawer-open { overflow: hidden; }
  .main { margin-left: 0; }
  body.is-mini .main { margin-left: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
}

@media (max-width: 900px) {
  .search__mic { display: none; }
  .suggestions { right: 0; }
  #themeBtn { display: none; }
}

@media (max-width: 768px) {
  .main { padding: calc(var(--header-h) + 10px) 16px 104px; }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 50;
    height: 64px;
    padding: 6px;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  }
  .mobile-nav__pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 0;
    z-index: 0;
    border-radius: 999px;
    background: rgba(120, 120, 128, .16);
    opacity: 0;
    transition: none;
  }
  .mobile-nav.has-active .mobile-nav__pill { opacity: 1; }
  .mobile-nav.is-ready .mobile-nav__pill {
    transition: transform .34s cubic-bezier(.2, .8, .2, 1), width .34s cubic-bezier(.2, .8, .2, 1), opacity .18s;
  }
  [data-theme="dark"] .mobile-nav__pill {
    background: rgba(255, 255, 255, .16);
  }
  .mobile-nav a {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    transition: background .16s var(--ease), color .18s var(--ease);
  }
  .mobile-nav a:hover { background: var(--hover); }
  .mobile-nav a i { font-size: 22px; transition: transform .18s var(--ease); }
  .mobile-nav a:active i { transform: scale(.88); }
  .mobile-nav a.is-active { color: var(--accent); font-weight: 600; }
  .mobile-nav a.is-active i { color: var(--accent); transform: translateY(-1px); }
  .mobile-nav a.is-tapped i { animation: mobileNavTap .4s var(--ease); }
  @keyframes mobileNavTap {
    0% { transform: scale(1); }
    40% { transform: scale(1.2); }
    100% { transform: scale(1); }
  }

  .toast { bottom: 92px; }

  .watch__title { font-size: 18px; }
  .watch__meta { gap: 12px; }
  .watch__actions { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .watch__actions::-webkit-scrollbar { display: none; }
  .rec { grid-template-columns: 150px minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .brand__name { font-size: 20px; }
  .suggestions { right: 0; }
  .create-btn { display: none; }
  .search__kbd { display: none; }
  .main { padding-left: 12px; padding-right: 12px; }
  .grid { grid-template-columns: 1fr; gap: 22px; }
  .short { flex-basis: 152px; }
  .results h1 { font-size: 18px; }
  .description { padding: 12px; }
  .comment-form { flex-wrap: wrap; }
  .comment-form .btn-contrast { margin-left: 44px; }
  .player { border-radius: 10px; }
  .player__time { font-size: 11px; }
  .player__btn { width: 32px; height: 32px; font-size: 17px; }
}

@media (max-width: 520px) {
  .brand__name { display: none; }
  .brand { padding: 4px 2px; }
  .notif-btn { display: none; }
  .watch__channel { width: 100%; }
  .watch__actions { width: 100%; }
  .watch__channel .btn-contrast { margin-left: auto; }
}

@media (hover: none) {
  .card__more { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
