/* =============================================================================
   SHORTS V2 — lecteur vertical (24/08/2026)

   Trois partis pris par rapport à v1 :
   - le RAIL d'actions porte l'auteur EN HAUT (avatar + pseudo), plus en bas à
     gauche : c'est la convention TikTok et ça libère toute la largeur du bas
     pour le titre et les chips ;
   - la barre de progression est un vrai scrubber en bas de cadre, avec une
     zone de préhension généreuse (la barre visible fait 3 px, la cible 22) ;
   - les typographies remontent (titre 15 px, commentaires 15 px) : le feed v1
     était illisible en usage réel.
   ============================================================================= */

:root {
  --shorts-brand: #EE2D3E;
  --shorts-ink: #fff;
  --shorts-dim: rgba(255,255,255,.82);
  --shorts-glass: rgba(0,0,0,.42);
  --shorts-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.5);

  /* Jetons attendus par vxg-smileys.css (picker partagé). Cette page est
     autonome : elle ne charge pas vxg-v2.css, il faut donc les poser ici,
     sinon le picker retombe sur ses valeurs par défaut. */
  --primary: #EE2D3E;
  --primary-glow: #ff3658;
  --foreground: #fff;
  --muted-foreground: #a9a9ae;
  --surface: #17171a;
  --surface-elevated: #202024;
  --border: rgba(255,255,255,.11);

  /* VXG 26/08 — aplat de CTA portant du TEXTE BLANC. Le rouge de marque
     plafonne a 4,13:1, sous le seuil AA de 4,5:1 pour du texte de 14-15 px.
     Ce jeton est le meme rouge assombri, a 5,30:1. Ne PAS l'utiliser comme
     couleur de texte : en avant-plan sur #131315 il tombe a 3,50:1, la ou
     --shorts-brand tient 4,49:1. */
  --shorts-brand-solid: #D31B2B;
}

/* ---- Page ---- */
.shorts-page {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--shorts-ink);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html.shorts-modal-open, html.scm-open { overflow: hidden; }

/* ---- Container: vertical scroll-snap ---- */
#shortsContainer {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}
#shortsContainer::-webkit-scrollbar { display: none; }

/* ---- Slide ---- */
.shorts-slide {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  overflow: hidden;
}
.shorts-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

/* ---- Poster ---- */
.shorts-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: opacity .35s ease;
}

/* ---- Video ---- */
.shorts-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  background: #000;
}

/* Voile bas + haut : le texte blanc reste lisible sur une image claire, sans
   assombrir le centre de la vidéo. */
.shorts-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* Le texte du feed est blanc sur une vidéo dont on ne maîtrise rien : sur un
     plan clair le contraste mesuré tombait à 1,2:1. Ce voile est ce qui garantit
     la lisibilité — ne pas l'alléger sans remesurer. */
  background:
    linear-gradient(to bottom, rgba(0,0,0,.46) 0, rgba(0,0,0,0) 20%),
    linear-gradient(to top, rgba(0,0,0,.86) 0, rgba(0,0,0,.62) 18%, rgba(0,0,0,.28) 36%, rgba(0,0,0,0) 54%);
}

/* ---- Tap zone ---- */
.shorts-tap-zone {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: pointer;
}

/* ===== Mise en veille de l'habillage (8 s sans geste) =====
   Tout le texte et les commandes s'effacent pour rendre le cadre à la vidéo ;
   le moindre contact les ramène. `visibility` suit l'opacité pour que rien ne
   reste cliquable une fois invisible — un bouton transparent qui répond est
   pire que pas de bouton. La zone de tap, elle, reste active : c'est elle qui
   réveille l'interface. */
.shorts-slide .shorts-rail,
.shorts-slide .shorts-info,
.shorts-slide .shorts-topright,
.shorts-slide .shorts-progress,
.shorts-back-btn,
.shorts-theme-banner.visible {
  transition: opacity .55s ease, visibility .55s ease;
}
.shorts-slide.chrome-idle .shorts-rail,
.shorts-slide.chrome-idle .shorts-info,
.shorts-slide.chrome-idle .shorts-topright,
.shorts-slide.chrome-idle .shorts-progress {
  opacity: 0;
  visibility: hidden;
}
html.shorts-idle .shorts-back-btn,
html.shorts-idle .shorts-theme-banner.visible {
  opacity: 0;
  visibility: hidden;
}
/* Un geste ramène tout : on ne fait pas patienter l'utilisateur. */
.shorts-slide:not(.chrome-idle) .shorts-rail,
.shorts-slide:not(.chrome-idle) .shorts-info,
.shorts-slide:not(.chrome-idle) .shorts-topright,
.shorts-slide:not(.chrome-idle) .shorts-progress {
  transition-duration: .16s;
}
@media (prefers-reduced-motion: reduce) {
  .shorts-slide .shorts-rail,
  .shorts-slide .shorts-info,
  .shorts-slide .shorts-topright,
  .shorts-slide .shorts-progress { transition-duration: .01s; }
}

/* ---- Loader ---- */
.shorts-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  pointer-events: none;
}
.shorts-loader[hidden] { display: none; }
.shorts-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: shortsPin .7s linear infinite;
}
@keyframes shortsPin { to { transform: rotate(360deg); } }

/* ---- Indicateur central UNIQUE (play / pause / son) ---- */
.shorts-center-ind {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.6);
  width: 76px;
  height: 76px;
  background: rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.shorts-center-ind.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.shorts-center-ind svg {
  width: 30px; height: 30px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Coin haut droit : son + HD ---- */
.shorts-topright {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 10px;
  z-index: 13;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.shorts-chip-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  color: #fff;
  background: var(--shorts-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 13px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: .04em;
  transition: opacity .15s ease, background-color .15s ease, transform .12s ease;
}
.shorts-chip-btn:active { transform: scale(.92); }
.shorts-chip-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* HD : « clair » quand inactif, blanc franc + liseré quand actif. */
.shorts-hd-btn { opacity: .5; }
.shorts-hd-btn.is-on {
  opacity: 1;
  color: #fff;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.9);
}
.shorts-hd-btn.is-na { opacity: .26; }

/* Indice « touche pour le son » : une seule fois, puis il disparaît. */
.shorts-sound-hint {
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 600; font-size: 12px; line-height: 1; font-family: inherit;
  white-space: nowrap;
  animation: shortsHintIn .3s ease both;
}
.shorts-sound-hint[hidden] { display: none; }
@keyframes shortsHintIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- Rail d'actions (droite) ---- */
.shorts-rail {
  position: absolute;
  right: 8px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 62px;
}

/* Auteur EN TÊTE du rail */
.shorts-rail-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-decoration: none;
  max-width: 62px;
}
.shorts-avatar {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.9);
  background: #232326;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.shorts-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shorts-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-weight: 700; font-size: 18px; line-height: 1; font-family: inherit; color: #fff;
  background: linear-gradient(140deg, #3a3a40, #202024);
}
.shorts-rail-name {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600; font-size: 11px; line-height: 1.2; font-family: inherit;
  text-shadow: var(--shorts-shadow);
}
.shorts-rail-user:active .shorts-avatar { transform: scale(.94); }

/* Boutons du rail */
.shorts-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  width: 62px;
  text-decoration: none;
  font-weight: 600; font-size: 11px; line-height: 1.15; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.shorts-act svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
  transition: fill .18s ease, stroke .18s ease, transform .18s ease;
}
.shorts-act-label {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: var(--shorts-shadow);
}
.shorts-act:active { transform: scale(.9); }
.shorts-act[disabled] { opacity: .5; cursor: default; }

/* Viewport court (téléphone en paysage, fenêtre réduite) : le rail est ancré en
   bas et grandit vers le haut. Sans repli il dépasse le cadre, et .shorts-stage
   (overflow:hidden) coupe l'auteur — donc l'avatar ET le lien vers le profil.
   Au-dessus de 1024 px le rail est HORS cadre : rien à corriger là. */
@media (max-height: 520px) and (max-width: 1023px) {
  .shorts-rail {
    top: calc(8px + env(safe-area-inset-top, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    /* Empilé, jamais remplacé : là où `safe` n'est pas reconnu, la seconde ligne
       est jetée et `flex-end` survit. `safe` évite qu'un débordement rogne au bord
       de DÉPART — c'est-à-dire l'auteur, en haut du rail, sans scroll pour y revenir. */
    justify-content: flex-end;
    justify-content: safe flex-end;
    gap: 6px;
    overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
  }
  .shorts-rail::-webkit-scrollbar { display: none; }
  .shorts-rail-user { gap: 3px; }
  .shorts-avatar { width: 34px; height: 34px; }
  .shorts-rail-name { font-size: 10px; }
  .shorts-act { gap: 3px; font-size: 10px; }
  .shorts-act svg { width: 20px; height: 20px; }
  .shorts-info { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .shorts-title { -webkit-line-clamp: 1; }
  .shorts-desc { display: none; }
}

/* Portrait court (webview in-app, petite fenêtre) : avec le 8e bouton, le rail
   pleine taille réclame ~575 px de hauteur. La media-query paysage ci-dessus ne
   couvre que sous 520 px : sans ce cran intermédiaire, la bande 521-600 px casse
   exactement comme le paysage — l'auteur rogné, sans scroll pour y revenir. */
@media (min-height: 521px) and (max-height: 600px) and (max-width: 1023px) {
  .shorts-rail { gap: 12px; }
  .shorts-act svg { width: 25px; height: 25px; }
}

/* Signet enregistré : plein, couleur marque. */
.shorts-act-bookmark.is-on svg { fill: var(--shorts-brand); stroke: var(--shorts-brand); }
.shorts-act-bookmark.pop svg { animation: shortsBookmarkPop .5s cubic-bezier(.22,1,.36,1); }
@keyframes shortsBookmarkPop {
  0% { transform: scale(1); } 35% { transform: scale(1.35); } 65% { transform: scale(.92); } 100% { transform: scale(1); }
}
/* Réaction : la flamme s'allume au survol/appui. */
.shorts-act-react:active svg { fill: #ff7a18; stroke: #ff7a18; }
.shorts-act-react[aria-expanded="true"] svg { fill: #ff7a18; stroke: #ff7a18; }
/* « Pas pour moi » : une fois exprimé, l'avis reste visible sur le slide. */
.shorts-act-meh.is-on { opacity: .55; }
.shorts-act-meh.is-on svg { stroke: var(--shorts-brand); }

/* ---- Bloc info (bas gauche) ---- */
.shorts-info {
  position: absolute;
  left: 14px;
  right: 78px;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.shorts-title {
  font-weight: 700; font-size: 15px; line-height: 1.32; font-family: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: var(--shorts-shadow);
}
.shorts-desc {
  font-weight: 400; font-size: 13.5px; line-height: 1.45; font-family: inherit;
  color: rgba(255,255,255,.9);
  text-shadow: var(--shorts-shadow);
}
.shorts-desc.clamp .shorts-desc-txt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shorts-desc-more {
  background: none; border: none; padding: 0;
  color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1; font-family: inherit; cursor: pointer; opacity: .85;
}

.shorts-social { display: flex; gap: 6px; flex-wrap: wrap; }
.shorts-social-btn {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 16px;
  font-weight: 700; font-size: 11.5px; line-height: 1; font-family: inherit; text-decoration: none; color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.shorts-of-btn { background: rgba(0,175,240,.82); }
.shorts-x-btn { background: rgba(255,255,255,.18); }

/* Chips catégories + tags — cliquables : elles rechargent le feed sur ce thème */
.shorts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.shorts-chip-cat, .shorts-chip-tag {
  font-weight: 600; font-size: 12px; line-height: 1; font-family: inherit;
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: background-color .15s ease, transform .12s ease;
}
.shorts-chip-cat {
  color: #fff;
  background: rgba(238,45,62,.24);
  border: 1px solid rgba(238,45,62,.55);
}
.shorts-chip-tag {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
}
.shorts-chip-cat:active, .shorts-chip-tag:active { transform: scale(.94); }

.shorts-meta {
  display: flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 12px; line-height: 1; font-family: inherit; color: var(--shorts-dim);
  text-shadow: var(--shorts-shadow);
}
.shorts-meta svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.shorts-meta-dot { opacity: .6; }

/* ---- Barre de progression (scrubber TikTok) ----
   La bande visible fait 3 px ; la CIBLE fait 22 px grâce au padding, sinon
   c'est injouable au doigt. touch-action:none pour que le drag ne soit pas
   confisqué par le scroll-snap vertical. */
.shorts-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  height: 22px;
  padding: 9px 0 10px;
  box-sizing: border-box;
  z-index: 15;
  cursor: pointer;
  touch-action: none;
}
.shorts-progress-track {
  position: relative;
  height: 3px;
  background: rgba(255,255,255,.24);
  border-radius: 2px;
  overflow: hidden;
  transition: height .14s ease;
}
.shorts-progress-fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}
.shorts-progress-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform .14s ease;
  pointer-events: none;
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
.shorts-progress-time {
  position: absolute;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-weight: 700; font-size: 12px; line-height: 1; font-family: inherit;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.shorts-progress:hover .shorts-progress-track,
.shorts-progress.dragging .shorts-progress-track { height: 5px; }
.shorts-progress:hover .shorts-progress-knob,
.shorts-progress.dragging .shorts-progress-knob { transform: translateY(-50%) scale(1); }
.shorts-progress.dragging .shorts-progress-time { opacity: 1; }

/* ---- Bouton retour ---- */
.shorts-back-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: var(--shorts-glass);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.shorts-back-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Bandeau de feed thématique ---- */
.shorts-theme-banner {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 21;
  display: none;
  align-items: center;
  gap: 6px;
  max-width: min(72vw, 420px);
  padding: 7px 7px 7px 14px;
  border-radius: 9999px;
  background: rgba(238,45,62,.92);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.shorts-theme-banner.visible { display: flex; opacity: 1; transform: translate(-50%, 0); }
.shorts-theme-label {
  font-weight: 700; font-size: 13px; line-height: 1.2; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shorts-theme-exit {
  flex: none;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.22);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shorts-theme-exit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ---- Toast ---- */
.shorts-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 10px);
  z-index: 300;
  max-width: min(84vw, 420px);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(20,20,22,.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  font: 600 13.5px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.shorts-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- Flamme animée (double-tap) ---- */
.shorts-pop {
  position: absolute; z-index: 7;
  width: 108px; height: 108px; margin: -54px 0 0 -54px;
  display: flex; align-items: center; justify-content: center;
  font-size: 86px; line-height: 1;
  opacity: 0; pointer-events: none; transform: scale(.2);
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.5));
}
.shorts-pop.pop { animation: shortsPop .8s ease-out forwards; }
@keyframes shortsPop {
  0%   { opacity: 0; transform: scale(.2) rotate(-12deg); }
  15%  { opacity: 1; transform: scale(1.15) rotate(6deg); }
  35%  { transform: scale(.95) rotate(-3deg); }
  70%  { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.1) translateY(-34px); }
}

/* ---- Réactions flottantes + palette ---- */
.shorts-react-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.shorts-react-float {
  position: absolute; bottom: 110px; font-size: 30px; line-height: 1; pointer-events: none;
  will-change: transform, opacity; animation: shortsReactRise 2.2s ease-out forwards;
}
@keyframes shortsReactRise {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(.6); }
  15%  { opacity: 1; transform: translateY(-20px) translateX(calc(var(--dx, 0px) * .3)) scale(1.1); }
  100% { opacity: 0; transform: translateY(-220px) translateX(var(--dx, 0px)) scale(1); }
}
.shorts-react-palette {
  position: fixed; z-index: 260; display: none; gap: 2px; padding: 8px 10px;
  background: rgba(20,20,22,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 9999px; box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.shorts-react-palette.open { display: flex; animation: shortsPalettePop .18s ease-out; }
@keyframes shortsPalettePop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
.shorts-react-emoji {
  width: 42px; height: 42px; border: none; background: none; cursor: pointer; font-size: 25px;
  line-height: 1; border-radius: 9999px; transition: transform .12s;
}
.shorts-react-emoji:hover, .shorts-react-emoji:active { transform: scale(1.25); background: rgba(255,255,255,.08); }

/* ---- Fin de feed / vide ---- */
.shorts-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100vh; height: 100dvh;
  color: rgba(255,255,255,.62); font-size: 16px; text-align: center; padding: 20px;
}
.shorts-empty a { display: inline-block; margin-top: 12px; color: var(--shorts-brand); font-weight: 700; text-decoration: none; }
.shorts-end-slide {
  height: 100vh; height: 100dvh; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center; background: #000;
}
.shorts-end {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; color: #fff; line-height: 1.5; padding: 24px;
}
.shorts-end strong { font-size: 21px; font-weight: 800; }
.shorts-end span { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.62); max-width: 30ch; }
/* Une fin de feed sans porte de sortie, c'est un mur. */
.shorts-end-restart {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 8px; padding: 14px 22px; min-height: 50px;
  border: none; border-radius: 9999px; cursor: pointer;
  background: var(--shorts-brand-solid); color: #fff;
  font-weight: 700; font-size: 16px; line-height: 1; font-family: inherit;
  box-shadow: 0 8px 24px rgba(238,45,62,.32);
  transition: transform .12s ease, filter .12s ease;
}
.shorts-end-restart:hover { filter: brightness(1.08); }
.shorts-end-restart:active { transform: scale(.95); }
.shorts-end-restart svg {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Proposition de reprise (offre, jamais une modale) ---- */
.shorts-resume {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -14px);
  z-index: 22;
  display: flex; align-items: stretch; gap: 2px;
  max-width: min(88vw, 460px);
  padding: 4px;
  border-radius: 9999px;
  background: rgba(20,20,22,.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 32px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.shorts-resume.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.shorts-resume-go {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 8px 14px 8px 12px; border: none; border-radius: 9999px;
  background: none; color: #fff; cursor: pointer; text-align: left;
  font-family: inherit;
}
.shorts-resume-go svg {
  width: 20px; height: 20px; flex: none;
  fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round;
  color: var(--shorts-brand);
}
.shorts-resume-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.shorts-resume-txt strong { font-size: 14px; font-weight: 700; line-height: 1.2; }
.shorts-resume-txt em {
  font-style: normal; font-size: 12px; line-height: 1.2;
  color: rgba(255,255,255,.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shorts-resume-x {
  flex: none; width: 40px; border: none; border-radius: 9999px;
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shorts-resume-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
html.shorts-idle .shorts-resume.visible { opacity: 0; visibility: hidden; }

/* ---- SSR intro (avant hydratation) ---- */
.shorts-ssr-intro { scroll-snap-align: start; }

/* =============================================================================
   Feuille générique (signalement) — même grammaire que la sheet commentaires
   ============================================================================= */
.shorts-sheet-overlay { position: fixed; inset: 0; z-index: 240; }
.shorts-sheet-overlay[hidden] { display: none; }
.shorts-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.shorts-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  max-height: 82dvh;
  background: #131315; color: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.6);
  animation: scmSlideUp .25s ease;
}
.shorts-sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.25); margin: 9px auto 2px; flex: none; }
.shorts-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; flex: none; }
.shorts-sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.shorts-sheet-close { background: none; border: none; color: #fff; cursor: pointer; padding: 4px; display: flex; }
.shorts-sheet-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.shorts-sheet-body { padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }

.shorts-rp-opts { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.shorts-rp-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px; cursor: pointer;
  font-size: 15px; line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.shorts-rp-opt input { width: 20px; height: 20px; accent-color: var(--shorts-brand); flex: none; }
.shorts-rp-field { display: block; }
.shorts-rp-field span { display: block; margin-bottom: 6px; font-size: 13px; color: rgba(255,255,255,.6); }
.shorts-rp-field textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 11px 13px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14); background: #1c1c20; color: #fff;
  font-weight: 400; font-size: 16px; line-height: 1.4; font-family: inherit;
}
.shorts-rp-send {
  width: 100%; margin-top: 14px; padding: 14px;
  border: none; border-radius: 12px;
  background: var(--shorts-brand-solid); color: #fff;
  font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; cursor: pointer;
}
.shorts-rp-send[disabled] { opacity: .6; cursor: default; }
.shorts-rp-msg { margin-top: 12px; padding: 11px 13px; border-radius: 10px; font-size: 14px; line-height: 1.4; }
.shorts-rp-msg.ok { background: rgba(40,180,99,.16); color: #6ee7a0; }
.shorts-rp-msg.err { background: rgba(238,45,62,.16); color: #ff8a93; }

/* =============================================================================
   OVERLAY COMMENTAIRES — lisibilité revue (v1 : 13/14 px, illisible en usage)
   ============================================================================= */
.shorts-comments-overlay { position: fixed; inset: 0; z-index: 200; }
.shorts-comments-overlay[hidden] { display: none; }
.scm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; animation: scmFade .2s ease forwards; }
@keyframes scmFade { to { opacity: 1; } }

.scm-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  height: 72dvh; max-height: 72dvh; background: #131315; color: #fff;
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.6);
  transform: translateY(0); transition: height .25s ease, transform .2s ease;
  animation: scmSlideUp .25s ease;
}
.scm-sheet.full { height: 94dvh; max-height: 94dvh; }
@keyframes scmSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.scm-handle { width: 40px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.25); margin: 9px auto 2px; flex: none; cursor: grab; touch-action: none; }
.scm-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; flex: none; border-bottom: 1px solid rgba(255,255,255,.07); }
.scm-title { font-size: 16px; font-weight: 700; margin: 0; }
.scm-count { color: rgba(255,255,255,.5); font-weight: 600; }
.scm-close { background: none; border: none; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 4px; }

.scm-list { flex: 1 1 auto; overflow-y: auto; padding: 6px 16px 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scm-item { display: flex; gap: 12px; padding: 13px 0; }
/* L'avatar peut être enveloppé dans un <a> vers le profil : c'est ALORS lui
   l'enfant flex, il doit porter le flex:none, sinon il se comprime. */
.scm-av-link { flex: none; display: block; line-height: 0; }
.scm-av { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: #2a2a2e; display: block; }
.scm-av-ph { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: #fff; background: linear-gradient(140deg, #3a3a40, #202024); }
.scm-body { flex: 1 1 auto; min-width: 0; }
.scm-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.scm-name { font-weight: 700; font-size: 14px; color: rgba(255,255,255,.78); text-decoration: none; }
a.scm-name:hover { color: #fff; text-decoration: underline; }
.scm-date { font-size: 12.5px; color: rgba(255,255,255,.42); }
/* Le corps du commentaire : 15,5 px comme sur la fiche vidéo du site. */
.scm-text { font-size: 15.5px; line-height: 1.5; margin-top: 3px; word-wrap: break-word; overflow-wrap: anywhere; color: #fff; }
.scm-likes { display: inline-block; margin-top: 6px; font-size: 12.5px; color: rgba(255,255,255,.5); }

/* Stickers maison dans le fil : même traitement que .list-comments du site. */
/* Plusieurs stickers à la suite doivent se ranger EN LIGNE : en `display:block`
   trois stickers faisaient 300 px de haut à eux seuls et repoussaient le fil. */
.scm-text .vxg-sticker, .scm-text .vxg-smiley-inline {
  display: inline-block;
  border-radius: 14px;
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  margin: 4px 4px 0 0;
  vertical-align: middle;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.34));
}
/* Un commentaire fait UNIQUEMENT de stickers a droit à la grande taille. */
.scm-text[data-solo="1"] .vxg-sticker,
.scm-text[data-solo="1"] .vxg-smiley-inline {
  width: 112px !important; height: 112px !important; max-width: 112px !important;
  border-radius: 18px;
}

.scm-empty, .scm-loading, .scm-error { text-align: center; color: rgba(255,255,255,.62); padding: 34px 16px; font-size: 15px; line-height: 1.6; }
.scm-empty span { display: block; margin-top: 4px; color: rgba(255,255,255,.42); font-size: 14px; }
.scm-more { display: block; width: 100%; margin: 10px 0; padding: 12px; background: rgba(255,255,255,.07); color: #fff; border: none; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* Composer */
.scm-form { flex: none; border-top: 1px solid rgba(255,255,255,.08); padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: #131315; }
.scm-login-cta { display: block; font-size: 14px; color: var(--shorts-brand); text-decoration: none; font-weight: 700; margin-bottom: 9px; }
.scm-anon { width: 100%; box-sizing: border-box; margin-bottom: 9px; min-height: 48px; padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: #1c1c20; color: #fff; font-size: 16px; }
.scm-input-row { display: flex; gap: 8px; align-items: flex-end; }
.scm-field { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 4px; min-width: 0; padding: 3px 5px 3px 4px; border-radius: 24px; border: 1px solid rgba(255,255,255,.16); background: #1c1c20; }
.scm-text-in {
  flex: 1 1 auto; min-width: 0; resize: none; max-height: 140px;
  /* Deux lignes pleines par défaut : à une seule ligne, le champ ressemblait à
     une rature sur un téléphone. Il s'agrandit ensuite tout seul (autoGrow). */
  min-height: 62px;
  padding: 12px 6px 12px 14px; border: none; background: none; color: #fff;
  font-weight: 400; font-size: 16px; line-height: 1.4; font-family: inherit; box-sizing: border-box; outline: none;
}
.scm-text-in::placeholder { color: rgba(255,255,255,.42); }
/* Le déclencheur du picker partagé (vxg-smileys.js) vit DANS le champ. */
.scm-field .vxg-smileys { flex: none; }
.scm-send {
  flex: none; padding: 0 20px; height: 50px; border: none; border-radius: 25px;
  background: var(--shorts-brand-solid); color: #fff; font-weight: 700; font-size: 16px; line-height: 1; font-family: inherit; cursor: pointer;
}
.scm-send.busy { opacity: .6; cursor: default; }
.scm-captcha-row { display: flex; gap: 8px; align-items: center; margin-top: 9px; }
.scm-captcha-img { height: 48px; border-radius: 8px; background: #fff; }
.scm-captcha-in { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: #1c1c20; color: #fff; font-size: 16px; }
.scm-captcha-refresh { flex: none; width: 48px; height: 48px; border: none; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-size: 19px; cursor: pointer; }
.scm-msg { margin-top: 9px; font-size: 14px; padding: 10px 13px; border-radius: 10px; line-height: 1.4; }
.scm-msg.ok { background: rgba(40,180,99,.16); color: #6ee7a0; }
.scm-msg.err { background: rgba(238,45,62,.16); color: #ff8a93; }

/* Téléphones étroits : le bouton d'envoi cède de la largeur au champ, mais
   garde sa hauteur de cible tactile. */
@media (max-width: 400px) {
  .scm-send { padding: 0 14px; }
  .scm-form { padding-left: 12px; padding-right: 12px; }
  .scm-list { padding-left: 12px; padding-right: 12px; }
}

/* Rangée de stickers d'amorce quand le fil est vide */
.scm-quick { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.scm-quick button {
  width: 64px; height: 64px; padding: 5px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  background: #17181a; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.scm-quick button:hover { border-color: rgba(238,45,62,.5); }
.scm-quick button:active { transform: scale(.9); }
.scm-quick img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* =============================================================================
   Tablette : colonne centrée
   ============================================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  #shortsContainer { max-width: 480px; margin: 0 auto; }
  .shorts-page { display: flex; align-items: stretch; justify-content: center; }
}

/* =============================================================================
   Desktop : carte 9:16 centrée + rail HORS cadre à droite
   ============================================================================= */
@media (min-width: 1024px) {
  .shorts-page { background: #060607; }
  #shortsContainer { max-width: none; margin: 0; }

  .shorts-slide { display: flex; align-items: center; justify-content: center; transition: padding-right .25s ease; }
  .shorts-stage {
    position: relative; width: auto; height: 92vh; max-height: 92vh;
    aspect-ratio: 9 / 16; background: #000; border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.65);
    /* Le rail sort du cadre (right:-76px) : garder overflow:hidden le
       tronquerait. Le rayon est porté par la vidéo et le voile. */
    overflow: visible;
  }
  .shorts-video, .shorts-poster, .shorts-stage::after { border-radius: 18px; }

  /* Le rail sort du cadre : la vidéo n'est plus masquée par les actions. */
  .shorts-rail { right: -76px; bottom: 10px; gap: 20px; }
  .shorts-act { transition: transform .12s ease; }
  .shorts-act:hover { transform: scale(1.1); }
  .shorts-act:hover svg { stroke: #fff; }
  .shorts-info { left: 18px; right: 18px; bottom: 40px; }
  .shorts-topright { top: 14px; right: 14px; flex-direction: row-reverse; align-items: center; }
  .shorts-progress { border-radius: 0 0 18px 18px; }

  /* Commentaires ouverts : la carte se décale, jamais masquée. */
  html.scm-open .shorts-slide { padding-right: 420px; }

  .scm-backdrop { background: rgba(0,0,0,.25); }
  .scm-sheet {
    left: auto; right: 0; top: 0; bottom: 0; width: 420px; height: 100vh; max-height: 100vh;
    border-radius: 0; transition: none; animation: scmSlideIn .25s ease;
  }
  .scm-sheet.full { height: 100vh; max-height: 100vh; }
  .scm-handle { display: none; }

  .shorts-sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: 460px; border-radius: 18px; animation: none; }
  .shorts-sheet-handle { display: none; }
}
@keyframes scmSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* =============================================================================
   Pub (interstitielle native + side-rail desktop) — inchangé fonctionnellement
   ============================================================================= */
.shorts-ad-slide { display: flex; align-items: center; justify-content: center; background: #08080a; }
.shorts-ad-card { position: relative; width: 100%; max-width: 480px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.shorts-encart-mention { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 16px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.shorts-ad-inner { width: 100%; min-height: 250px; display: flex; align-items: center; justify-content: center; }
.shorts-ad-ph { text-align: center; color: rgba(255,255,255,.5); font-size: 14px; line-height: 1.6; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; padding: 40px 20px; width: 100%; box-sizing: border-box; }
.shorts-ad-ph span { font-size: 12px; color: rgba(255,255,255,.3); }
.shorts-ad-skip { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); padding: 12px 20px; border: none; border-radius: 9999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }

.shorts-side-rail { display: none; }
@media (min-width: 1024px) {
  .shorts-side-rail {
    position: fixed;
    /* La carte fait 0,5175 x 92vh de large et reste centrée : son bord gauche
       est à 50vw - 25.875vh. Tant que la gouttière loge 24 + 300 px, min() rend
       24px (comportement inchangé) ; quand elle se referme — vers 1024-1150 px
       de large — le rail sort par la gauche au lieu de recouvrir le cadre
       (z-index 50 > progression 15, coin haut droit 13, rail d'actions 10). */
    left: min(24px, calc(50vw - 25.875vh - 324px));
    top: 50%; transform: translateY(-50%);
    width: 300px; max-height: 80vh; z-index: 50; display: block;
  }
  .shorts-side-rail[hidden] { display: none; }
  .shorts-side-rail .shorts-ad-inner { min-height: 250px; }
}
.shorts-ad-vast-host { width: 100%; display: flex; align-items: center; justify-content: center; }
.shorts-ad-video { width: 100%; max-height: 72vh; object-fit: contain; background: #000; border-radius: 12px; }

/* =============================================================================
   Mode OVERLAY : la page est encastrée dans une iframe dont c'est l'HÔTE qui
   fixe la taille (`.shorts-overlay iframe` dans vxg-v2.css). Rien ne garantit
   que ce cadre soit au format 9:16 — mesuré sur la règle en place
   (`max-width:420px; max-height:92vh`) : 420 x 828 sur un portable 1440x900,
   420 x 1288 sur un écran 1440p, soit un rapport de 0,33 contre 0,5625. Avec
   `object-fit: cover`, jusqu'à 42% de la largeur de l'image était rognée.

   La scène se recadre donc elle-même au bon rapport, quel que soit le cadre
   reçu : deux bandes noires valent mieux qu'une vidéo massacrée. Si l'hôte
   passe un cadre déjà en 9:16, les bandes disparaissent d'elles-mêmes et rien
   ne change. C'est volontairement défensif : la page ne doit pas dépendre de
   la justesse du CSS de celui qui l'embarque.
   ============================================================================= */
.shorts-page-overlay .shorts-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.shorts-page-overlay .shorts-stage {
  /* Deux expressions du MÊME rectangle 9:16 inscrit dans le cadre : celle qui
     borne dépend de la forme du cadre, et l'autre suit. */
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  flex: none;
  border-radius: 0;
  /* Le bloc desktop passe la scène en `overflow: visible` pour laisser sortir
     le rail ; ici la scène EST le cadre utile, rien ne doit en déborder. */
  overflow: hidden;
}
/* Et si l'hôte donnait un jour un cadre de plus de 1024 px, le rail ne doit pas
   sortir de la carte : dans une iframe il tomberait hors champ. */
.shorts-page-overlay .shorts-rail {
  right: 8px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ---- Overlay desktop du site (shorts-overlay.js) ---- */
.shorts-overlay {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.shorts-overlay.visible { opacity: 1; pointer-events: all; }
.shorts-overlay-close {
  position: absolute; top: 18px; right: 18px; width: 42px; height: 42px;
  background: rgba(255,255,255,.08); border: none; border-radius: 50%;
  color: #fff; font-size: 22px; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.shorts-overlay-close:hover { background: rgba(255,255,255,.15); }
.shorts-overlay iframe {
  width: 100%; max-width: 460px; height: 100vh; height: 100dvh; max-height: 92vh;
  border: none; border-radius: 12px; overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .shorts-react-float { animation-duration: 1.2s; }
  .shorts-pop.pop { animation-duration: .4s; }
  .scm-backdrop, .scm-sheet, .shorts-sheet { animation: none; }
}

/* =============================================================
   VXG 26/08 — Casting, fiche acteur, téléchargement
   Même grammaire que le reste de la page : pastilles arrondies, verre sombre,
   `--shorts-brand` pour l'action principale, `--shorts-shadow` pour tout ce qui
   se pose SUR la vidéo. Rien de neuf en tokens.
   ============================================================= */

/* ---- Rangée casting (dans le bloc info, sous la description) ---- */
.shorts-cast {
  display: flex;
  /* Les noms se serraient a deux lettres des trois acteurs : le repli existant
     etait conditionne a la HAUTEUR (media paysage) alors que la contrainte est
     horizontale. On laisse le flexbox mesurer le vrai conteneur. */
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.shorts-cast-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 132px;
  padding: 3px 10px 3px 3px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9999px;
  background: rgba(0,0,0,.42);
  background: var(--shorts-glass);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, transform .12s ease;
}
.shorts-cast-chip:active { transform: scale(.94); }
/* Une seule vignette : elle peut respirer et porter le nom en entier. */
.shorts-cast > .shorts-cast-chip:only-child { max-width: 100%; }
.shorts-cast-av {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: rgba(255,255,255,.12);
}
.shorts-cast-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; display: block; }
.shorts-cast-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-weight: 700; font-size: 13px;
  color: rgba(255,255,255,.75);
}
.shorts-cast-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: var(--shorts-shadow);
}
/* Bouton « +N » : même pastille, sans vignette. */
.shorts-cast-rest {
  padding: 0 11px;
  height: 30px;
  justify-content: center;
  font-size: 12.5px;
}

/* ---- Feuille : liste des formats de téléchargement ---- */
.shorts-dl-list { display: flex; flex-direction: column; gap: 2px; }
.shorts-dl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 4px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: none;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.shorts-dl-row:last-child { border-bottom: none; }
.shorts-dl-row:active { background: rgba(255,255,255,.06); }
.shorts-dl-ic { flex: none; display: flex; opacity: .75; }
.shorts-dl-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shorts-dl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shorts-dl-txt strong { font-size: 15px; font-weight: 600; }
.shorts-dl-txt small { font-size: 12.5px; color: var(--muted-foreground); }
.shorts-dl-go { flex: none; display: flex; opacity: .45; }
.shorts-dl-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Feuille : fiche acteur ---- */
/* Bande de bascule quand la vidéo porte plusieurs acteurs. Scroll horizontal
   contenu : sans `overscroll-behavior`, le geste enchaînerait sur le snap
   vertical du feed derrière la feuille. */
.shorts-ac-switch {
  display: flex;
  gap: 8px;
  padding: 2px 0 14px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.shorts-ac-switch::-webkit-scrollbar { display: none; }
.shorts-ac-tab {
  flex: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s ease, border-color .15s ease;
}
.shorts-ac-tab img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; display: block; }
.shorts-ac-tab.is-on { opacity: 1; border-color: var(--shorts-brand); }

.shorts-ac-card { display: flex; align-items: center; gap: 14px; }
.shorts-ac-av {
  flex: none;
  width: 76px; height: 76px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: rgba(255,255,255,.1);
}
.shorts-ac-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; display: block; }
.shorts-ac-av .shorts-cast-ph { font-size: 30px; }
.shorts-ac-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shorts-ac-id strong { font-size: 19px; font-weight: 700; line-height: 1.2; }
.shorts-ac-place { font-size: 13px; color: var(--muted-foreground); }

.shorts-ac-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.shorts-ac-pill {
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9999px;
  background: rgba(255,255,255,.07);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.shorts-ac-none { margin: 14px 0 0; font-size: 13px; color: var(--muted-foreground); }
.shorts-ac-social { margin-top: 14px; }

/* Deux actions, côte à côte, la principale en couleur de marque : « voir ses
   Xreels » garde l'utilisateur dans le feed, « voir sa fiche » l'en sort. */
.shorts-ac-actions { display: flex; gap: 8px; margin-top: 18px; }
.shorts-ac-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 13px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font: inherit;
  font-size: 14.5px; font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease;
}
.shorts-ac-btn.is-primary {
  border-color: transparent;
  background: var(--shorts-brand-solid);
}
.shorts-ac-btn:active { transform: scale(.97); }

/* La description dépliée devient un scroller : contenu, pour ne pas enchaîner
   sur le snap vertical du feed. */
.shorts-desc:not(.clamp) .shorts-desc-txt {
  display: block;
  max-height: 34dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Viewport court (téléphone en paysage) : la description est déjà masquée par
   la règle existante ; le casting reste, mais réduit aux vignettes. */
@media (max-height: 520px) and (max-width: 1023px) {
  .shorts-cast-name { display: none; }
  .shorts-cast-chip { max-width: none; padding: 3px; }
  .shorts-cast-rest { padding: 0 9px; }
}
