/* Evotic Edge — Vibes Feed v2 (refonte 2026-05-31, Lot 1).
   Feed vertical FYP plein écran. Chargé uniquement quand le flag vibes_feed_v2
   est actif (stories.html). N'altère pas stories.css (deck legacy). */

/* Conteneur scroll-snap vertical, sous la topbar transparente. */
.vf-feed {
  position: fixed;
  inset: 0;
  height: 100dvh;
  width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: #000;
  scrollbar-width: none;
}
.vf-feed::-webkit-scrollbar { display: none; }

/* Une vibe = un plein écran. */
.vf-card {
  position: relative;
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background-color: #000;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-media-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vf-media {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* 9:16 plein écran (modèle TikTok) ; clips déjà 9:16 → crop ~nul */
  background: #000;
}

/* Légende bas, sur voile dégradé pour lisibilité. */
.vf-caption {
  position: absolute;
  left: 14px;
  right: 84px;             /* laisse la place au rail droit */
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  color: #fff;
  font: 600 15px/1.35 var(--font, system-ui);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  max-height: 30vh;
  overflow-y: auto;
  word-break: break-word;
}
.vf-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
  z-index: 2;
}

/* Spinner poster-only tant que le média n'a pas démarré. */
.vf-spin {
  position: absolute;
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vf-spin .9s linear infinite;
  z-index: 3;
}
.vf-card.vf-playing .vf-spin { display: none; }
@keyframes vf-spin { to { transform: rotate(360deg); } }

/* Indice tap-to-play (tier bas / pas d'autoplay). */
.vf-card.vf-tap-to-play::before {
  content: "\f04b";  /* fa-play */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  z-index: 6;
  color: rgba(255,255,255,.92);
  font-size: 30px;
  width: 74px; height: 74px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.42);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Rail d'actions droite (réactions + pourboire). */
.vf-rail {
  position: fixed;
  right: 10px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.vf-rail-btn {
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.40);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
  transition: transform .15s ease;
}
.vf-rail-btn:active { transform: scale(.9); }
.vf-rail-btn.bounce { animation: vf-bounce .42s ease; }
@keyframes vf-bounce { 0%,100% { transform: scale(1); } 40% { transform: scale(1.35); } }

.vf-tip-btn {
  background: linear-gradient(135deg, #F5B027, #E08D00);
  box-shadow: 0 4px 14px rgba(245,176,39,.45);
  font-size: 20px;
}

/* Disque son rotatif (façon TikTok) — raccourci direct « utiliser ce son ».
   Vinyle sombre + avatar du créateur au centre, qui tourne en continu. */
.vf-sound-disc {
  width: 46px; height: 46px;
  padding: 0;
  border: 3px solid #141414;
  border-radius: 50%;
  background: #0c0c0c;
  color: #ff9a3c;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.5), inset 0 0 0 5px rgba(0,0,0,.6);
  animation: vf-disc-spin 4s linear infinite;
}
.vf-sound-disc .vf-disc-av,
.vf-sound-disc img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.vf-sound-disc:active { transform: scale(.92); }
@keyframes vf-disc-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vf-sound-disc { animation: none; } }

/* Stream de réactions volantes (local). */
.vf-react-stream {
  position: fixed;
  right: 0; bottom: 120px;
  width: 90px; height: 50vh;
  z-index: 39;
  pointer-events: none;
  overflow: hidden;
}
.vf-react-fly {
  position: absolute;
  bottom: 0;
  animation: vf-fly 2.3s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes vf-fly {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-46vh) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vf-react-fly, .vf-spin { animation: none; }
}

/* ── Lot 2 — rail engagement (like/comment/save/share/tip) ── */
.vf-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.vf-rail-count {
  color: #fff;
  font: 700 12px/1 var(--font, system-ui);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  min-height: 12px;
}
.vf-like-btn i, .vf-save-btn i, .vf-comment-btn i, .vf-share-btn i { transition: transform .12s ease; }
.vf-like-btn.active { color: #FF2D55; }
.vf-like-btn.active i { color: #FF2D55; }
.vf-save-btn.active { color: #F5B027; }
.vf-save-btn.active i { color: #F5B027; }

/* Bouton Suivre dans la topbar (à côté du pseudo). */
.vf-follow-btn {
  margin-left: 8px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  padding: 6px 12px;
  font: 800 12px/1 var(--font, system-ui);
  color: #fff;
  background: var(--brand, #6750A4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.vf-follow-btn.following {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Chip streak (flamme) — coin haut gauche sous le header. */
.vf-streak {
  position: fixed;
  left: 12px;
  top: calc(58px + env(safe-area-inset-top, 0px));
  z-index: 41;
  background: rgba(0,0,0,.5);
  color: #FFB020;
  font: 800 14px/1 var(--font, system-ui);
  padding: 7px 12px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.vf-streak i { color: #FF6A00; }

/* ── Comments bottom sheet ── */
.vf-comments-sheet { position: fixed; inset: 0; z-index: 120; }
.vf-cs-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.vf-cs-card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 72dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface, #14141c);
  color: var(--text, #fff);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: vf-sheet-up .22s ease-out;
}
@keyframes vf-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.vf-cs-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 800; font-size: 15px;
  border-bottom: 1px solid rgba(128,128,128,.18);
}
.vf-cs-close { background: transparent; border: 0; color: inherit; font-size: 18px; cursor: pointer; }
.vf-cs-list { flex: 1; overflow-y: auto; padding: 8px 14px; min-height: 120px; }
.vf-cs-loading, .vf-cs-empty { text-align: center; color: rgba(160,160,170,.9); font-size: 13px; padding: 24px 0; }
.vf-cs-row { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
.vf-cs-av { flex: 0 0 auto; }
.vf-cs-body { flex: 1; min-width: 0; }
.vf-cs-author { font-weight: 800; font-size: 13px; }
.vf-cs-time { font-weight: 600; font-size: 11px; color: rgba(160,160,170,.8); margin-left: 6px; }
.vf-cs-text { font-size: 14px; line-height: 1.4; word-break: break-word; margin-top: 1px; }
.vf-cs-del { background: transparent; border: 0; color: rgba(160,160,170,.7); cursor: pointer; padding: 4px; }
.vf-cs-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid rgba(128,128,128,.18); }
.vf-cs-input {
  flex: 1; border: 1px solid rgba(128,128,128,.3); border-radius: 22px;
  padding: 10px 14px; font: 500 14px var(--font, system-ui);
  background: rgba(128,128,128,.1); color: inherit;
}
.vf-cs-input:focus { outline: none; border-color: var(--brand, #6750A4); }
.vf-cs-send {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--brand, #6750A4); color: #fff; font-size: 16px; cursor: pointer;
}

/* ── Lot 5 — cadeaux animés ── */
.vf-gift-sheet { position: fixed; inset: 0; z-index: 130; }
.vf-gift-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.vf-gift-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface, #14141c); color: var(--text, #fff);
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom,0px));
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
  animation: vf-sheet-up .22s ease-out;
}
.vf-gift-head { font-weight: 800; font-size: 15px; text-align: center; margin-bottom: 14px; }
.vf-gift-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 380px) { .vf-gift-grid { grid-template-columns: repeat(3, 1fr); } }
.vf-gift-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid rgba(128,128,128,.22); border-radius: 14px;
  padding: 12px 6px; background: rgba(128,128,128,.08); color: inherit; cursor: pointer;
}
.vf-gift-opt:active { transform: scale(.95); }
.vf-gift-opt:disabled { opacity: .5; }
.vf-gift-emoji { font-size: 30px; line-height: 1; }
.vf-gift-label { font-size: 11px; font-weight: 700; }
.vf-gift-cost { font-size: 11px; font-weight: 800; color: #F5B027; }
.vf-gift-cancel {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 12px;
  background: rgba(128,128,128,.15); color: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
}

.vf-gift-fly {
  position: fixed; left: 50%; bottom: 28%;
  transform: translateX(-50%);
  font-size: 64px; z-index: 140;
  pointer-events: none;
  animation: vf-gift-rise 2.1s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes vf-gift-rise {
  0%   { transform: translateX(-50%) translateY(40px) scale(.3); opacity: 0; }
  18%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.25); }
  40%  { transform: translateX(-50%) translateY(-10px) scale(1); }
  100% { transform: translateX(-50%) translateY(-52vh) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .vf-gift-fly { animation: none; opacity: 0; } }

/* ── Lot H — hashtags & découverte ── */
.vf-tag { color: #7fd0ff; font-weight: 800; cursor: pointer; }
.vf-tag:active { opacity: .7; }

/* Bouton tendances (#) — coin haut droit, sous flip/torch. */
.vf-trends-btn {
  position: fixed;
  right: 12px;
  top: calc(108px + env(safe-area-inset-top, 0px));
  z-index: 41;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Cœur double-tap (façon TikTok) — éclot à l'endroit du tap, purement décoratif. */
.vf-tap-heart {
  position: fixed; z-index: 200; pointer-events: none;
  font-size: 80px; will-change: transform, opacity;
  transform: translate(-50%, -50%) scale(0);
  animation: vf-tap-heart .8s cubic-bezier(.2,.7,.3,1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
@keyframes vf-tap-heart {
  0%   { transform: translate(-50%,-50%) scale(0) rotate(-12deg); opacity: 0; }
  15%  { transform: translate(-50%,-50%) scale(1.25) rotate(-8deg); opacity: 1; }
  35%  { transform: translate(-50%,-50%) scale(1) rotate(-8deg); opacity: 1; }
  100% { transform: translate(-50%,-66%) scale(1.1) rotate(-8deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .vf-tap-heart { animation: none; opacity: 0; } }

/* Filtres catégories (Tout / Duel / Cherche duo / Moments) — top-center façon TikTok. */
.vf-cats {
  position: fixed; z-index: 42;
  top: calc(52px + env(safe-area-inset-top, 0px));
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 4px;
  background: rgba(0,0,0,.4); border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  max-width: calc(100vw - 120px); overflow-x: auto; scrollbar-width: none;
}
.vf-cats::-webkit-scrollbar { display: none; }
.vf-cat {
  border: 0; background: transparent; color: rgba(255,255,255,.78);
  font-family: inherit; font-size: 12.5px; font-weight: 800;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.vf-cat.active { background: #fff; color: #111; }

/* Toggle mute persistant (parité natif) — coin haut droit, au-dessus du bouton #. */
.vf-mute-toggle {
  position: fixed;
  right: 12px;
  top: calc(60px + env(safe-area-inset-top, 0px));
  z-index: 41;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .15s ease;
}
.vf-mute-toggle.vf-muted { background: rgba(0,0,0,.62); }

/* ── Barre du bas façon TikTok (2026-06-02) — fine, caméra surélevée au milieu ── */
.vibes-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: 52px; padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(8,8,12,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.08);
}
.vbn-item {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: rgba(255,255,255,.6); text-decoration: none; font-size: 10px; font-weight: 600;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.vbn-item i { font-size: 18px; }
.vbn-item.active { color: #fff; }
.vbn-item.active i { color: #6750A4; }
.vbn-cam {
  flex: 0 0 auto; width: 52px; height: 36px; margin-top: -8px;
  border: 0; border-radius: 11px; background: #6750A4; color: #fff;
  font-size: 19px; cursor: pointer; box-shadow: 0 3px 12px rgba(103, 80, 164,.5);
  display: flex; align-items: center; justify-content: center;
}
.vbn-cam:active { transform: scale(.94); }
/* Lève les contrôles du feed au-dessus de la barre (52px) */
.has-vibes-nav .vf-caption { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.has-vibes-nav .vf-rail { bottom: calc(114px + env(safe-area-inset-bottom, 0px)); }
/* Le bouton + du header haut devient redondant (caméra dans la barre) */
.has-vibes-nav #post-vibe-btn { display: none; }

/* Chip "tag actif" — haut centre. */
.vf-tag-active {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: calc(56px + env(safe-area-inset-top, 0px));
  z-index: 42;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand, #6750A4); color: #fff;
  font: 800 13px/1 var(--font, system-ui);
  padding: 8px 14px; border-radius: 18px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.vf-tag-active .vf-tag-clear { opacity: .85; font-weight: 700; }

/* Sheet tendances. */
.vf-trends-sheet { position: fixed; inset: 0; z-index: 130; }
.vf-trends-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.vf-trends-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 70dvh; display: flex; flex-direction: column;
  background: var(--surface, #14141c); color: var(--text, #fff);
  border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 24px rgba(0,0,0,.4); animation: vf-sheet-up .22s ease-out;
}
.vf-trends-head { font-weight: 800; font-size: 15px; padding: 14px 16px; border-bottom: 1px solid rgba(128,128,128,.18); }
.vf-trends-list { flex: 1; overflow-y: auto; padding: 8px 12px; min-height: 100px; }
.vf-trends-loading, .vf-trends-empty { text-align: center; color: rgba(160,160,170,.9); font-size: 13px; padding: 24px 12px; line-height: 1.5; }
.vf-trends-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 0; border-bottom: 1px solid rgba(128,128,128,.12);
  background: transparent; color: inherit; cursor: pointer;
  padding: 13px 6px; font: 800 15px var(--font, system-ui);
}
.vf-trends-item small { color: rgba(160,160,170,.9); font-weight: 700; }
.vf-trends-close { margin: 12px 14px; padding: 12px; border: 0; border-radius: 12px; background: rgba(128,128,128,.15); color: inherit; font-weight: 800; cursor: pointer; }
