/* VVhite Angel — direct Twitch */
.vv-live { padding: 0 0 40px; }
.vv-live[hidden] { display: none; }
.vv-live-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.vv-live-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: #fff;
}
.vv-live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e91916; box-shadow: 0 0 10px #e91916;
  animation: vvLiveDot 1.6s ease-in-out infinite;
}
@keyframes vvLiveDot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.vv-live-meta { flex: 1; min-width: 0; font-size: 14px; color: var(--muted, #6b7295); }
.vv-live-link { font-size: 13px; font-weight: 700; color: var(--accent2, #7ecef4); text-decoration: none; }

.vv-live-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.vv-live-grid.has-chat { grid-template-columns: minmax(400px, 1fr) 340px; }
.vv-live-player {
  position: relative;
  aspect-ratio: 16 / 9;
  min-width: 400px; min-height: 300px;   /* minimum imposé par Twitch */
  background: #0d0f18;
  border: 1px solid var(--border, rgba(58,159,213,.18));
  border-radius: 6px; overflow: hidden;
}
.vv-live-chat {
  height: 100%; min-height: 360px;
  border: 1px solid var(--border, rgba(58,159,213,.18));
  border-radius: 6px; overflow: hidden;
}
.vv-live-player iframe, .vv-live-chat iframe { width: 100%; height: 100%; display: block; border: 0; }

/* Vignette flottante */
.vv-live--float {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  padding: 0; width: 420px; max-width: calc(100vw - 32px);
}
.vv-live--float .vv-container { padding: 12px; background: var(--card, #0d0f18); border: 1px solid var(--border, rgba(58,159,213,.18)); border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.vv-live--float .vv-live-grid.has-chat { grid-template-columns: 1fr; }
.vv-live--float .vv-live-chat { display: none; }
.vv-live--float .vv-live-meta { display: none; }
.vv-live-close {
  position: absolute; top: 4px; right: 6px;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}

@media (max-width: 900px) {
  .vv-live-grid.has-chat { grid-template-columns: 1fr; }
  .vv-live-chat { min-height: 300px; }
  .vv-live--float { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}
@media (max-width: 460px) {
  .vv-live-player { min-width: 0; }
}

/* =========================================================
   Fenêtre flottante (déplaçable, redimensionnable)
   ========================================================= */
.vv-livewin {
  position: fixed; z-index: 950;
  left: 20px; bottom: 20px;            /* repli avant placement par le script */
  width: var(--vv-livewin-w, 420px);
  max-width: calc(100vw - 16px);
  background: var(--card, #0d0f18);
  border: 1px solid var(--border, rgba(58,159,213,.25));
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  overflow: hidden;
  font-family: var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif));
}
.vv-livewin[hidden] { display: none; }
.vv-livewin-bar {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px 0 12px;
  background: var(--bg3, #13151f);
  border-bottom: 1px solid var(--border, rgba(58,159,213,.18));
  cursor: grab; user-select: none; touch-action: none;
}
.vv-livewin[data-drag="0"] .vv-livewin-bar { cursor: default; }
.vv-livewin.is-moving .vv-livewin-bar { cursor: grabbing; }
.vv-livewin-bar:focus-visible { outline: 2px solid var(--accent2, #7ecef4); outline-offset: -2px; }
.vv-livewin-title { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; }
.vv-livewin-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--muted, #6b7295); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vv-livewin-btn {
  flex-shrink: 0;
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; background: transparent;
  color: #c8d4e8; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.vv-livewin-btn:hover, .vv-livewin-btn:focus-visible { background: rgba(255,255,255,.08); color: #fff; }
.vv-livewin-body { display: flex; flex-direction: column; }
.vv-livewin .vv-live-player {
  min-width: 0; min-height: 300px;     /* minimum imposé par Twitch */
  aspect-ratio: 16 / 9;
  border: 0; border-radius: 0;
}
.vv-livewin .vv-live-chat {
  display: block;
  height: var(--vv-livewin-chat, 260px); min-height: 0;
  border: 0; border-top: 1px solid var(--border, rgba(58,159,213,.18)); border-radius: 0;
}
.vv-livewin.is-min .vv-livewin-body,
.vv-livewin.is-min .vv-livewin-resize { display: none; }
.vv-livewin-resize {
  position: absolute; right: 0; bottom: 0;
  width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, rgba(126,206,244,.55) 50%, rgba(126,206,244,.55) 60%, transparent 60%, transparent 70%, rgba(126,206,244,.55) 70%, rgba(126,206,244,.55) 80%, transparent 80%);
}
/* Pendant un déplacement : les iframes ne captent plus le pointeur */
.vv-livewin.is-moving iframe,
.vv-livewin-dragging .vv-livewin iframe { pointer-events: none; }
.vv-livewin-dragging, .vv-livewin-dragging * { user-select: none !important; }

/* Mobile : ancrée en bas, pleine largeur */
.vv-livewin.is-docked {
  left: 0 !important; right: 0; top: auto !important; bottom: 0;
  width: 100% !important; max-width: none;
  border-radius: 10px 10px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.vv-livewin.is-docked .vv-livewin-bar { cursor: default; }
.vv-livewin.is-docked .vv-live-player { min-height: 0; }
.vv-livewin.is-docked .vv-livewin-resize { display: none; }
@media (max-width: 600px) {
  .vv-livewin.hide-mobile { display: none !important; }
}
.vv-livewin .vv-live-chat[hidden] { display: none; }

/* =========================================================
   Apparence (Direct Twitch › Apparence) : variables --vvl-*
   ========================================================= */
.vv-live { font-family: var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif)); background: var(--vvl-banner, none); padding: var(--vvl-pad, 0) 0 calc(var(--vvl-pad, 0px) + 40px); }
.vv-live.vvl-full .vv-container { max-width: none; padding-left: 24px; padding-right: 24px; }
.vv-live-card {
  position: relative; isolation: isolate;
  padding: 16px;
  background: var(--vvl-card, transparent);
  border: var(--vvl-bw, 0) solid var(--vvl-accent, transparent);
  border-radius: var(--vvl-r, 0);
}
.vv-live-title { font-family: var(--vvl-font, var(--vvt-font-titres, var(--font-display, 'Rajdhani', 'Open Sans', sans-serif))); color: var(--vvl-title-c, #fff); font-size: var(--vvl-title-s, 18px); }
.vvl-upper .vv-live-title, .vvl-upper .vv-livewin-title { text-transform: uppercase; letter-spacing: .04em; }
.vv-live-dot { background: var(--vvl-dot, #e91916); box-shadow: 0 0 10px var(--vvl-dot, #e91916); flex-shrink: 0; }
.vv-live-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--vvl-meta, var(--muted, #6b7295)); margin: 0; }
.vv-live-meta span:empty { display: none; }
.vv-live-game { font-weight: 700; }
.vv-live-badge {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; line-height: 1.2;
  background: var(--vvl-badge-bg, #e91916); color: var(--vvl-badge-c, #fff);
  font-family: var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif)); text-transform: uppercase; white-space: nowrap;
}
.vvl-badge-pulse .vv-live-badge { animation: vvlBadgePulse 1.6s ease-in-out infinite; }
.vvl-badge-blink .vv-live-badge { animation: vvlBadgeBlink 1.8s ease-in-out infinite; }
.vvl-badge-glow .vv-live-badge { animation: vvlBadgeGlow 2s ease-in-out infinite; }
@keyframes vvlBadgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes vvlBadgeBlink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes vvlBadgeGlow { 0%, 100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 0 14px var(--vvl-badge-bg, #e91916); } }

/* Bouton vers Twitch */
.vv-live-link { color: var(--vvl-accent2, var(--accent2, #7ecef4)); }
.vvl-cta-button .vv-live-link, .vvl-cta-outline .vv-live-link { padding: 7px 14px; border-radius: 6px; transition: filter .2s, background .2s; }
.vvl-cta-button .vv-live-link { background: var(--vvl-accent, #9146ff); color: #fff; }
.vvl-cta-button .vv-live-link:hover { filter: brightness(1.15); }
.vvl-cta-outline .vv-live-link { border: 1px solid var(--vvl-accent, #9146ff); color: var(--vvl-accent, #9146ff); }
.vvl-cta-outline .vv-live-link:hover { background: var(--vvl-accent, #9146ff); color: #fff; }

.vv-live-grid.has-chat { grid-template-columns: minmax(400px, 1fr) var(--vvl-chat-w, 340px); }
.vv-live-player, .vv-live-chat { border-color: color-mix(in srgb, var(--vvl-accent, #3a9fd5) 30%, transparent); }

/* Lueur et animation du cadre (bandeau .vv-live-card, fenêtre .vv-livewin) */
.vvl-glow-soft .vv-live-card, .vv-livewin.vvl-glow-soft { box-shadow: 0 0 18px color-mix(in srgb, var(--vvl-accent, #9146ff) 35%, transparent), 0 18px 50px rgba(0,0,0,.5); }
.vvl-glow-strong .vv-live-card, .vv-livewin.vvl-glow-strong { box-shadow: 0 0 34px color-mix(in srgb, var(--vvl-accent, #9146ff) 65%, transparent), 0 18px 50px rgba(0,0,0,.5); }
.vvl-anim-pulse .vv-live-card, .vv-livewin.vvl-anim-pulse { animation: vvlPulse var(--vvl-speed, 4s) ease-in-out infinite; }
.vvl-anim-breathe .vv-live-card, .vv-livewin.vvl-anim-breathe { animation: vvlBreathe var(--vvl-speed, 4s) ease-in-out infinite; }
@keyframes vvlPulse {
  0%, 100% { box-shadow: 0 0 8px color-mix(in srgb, var(--vvl-accent, #9146ff) 25%, transparent); }
  50% { box-shadow: 0 0 36px color-mix(in srgb, var(--vvl-accent, #9146ff) 75%, transparent); }
}
@keyframes vvlBreathe {
  0%, 100% { border-color: var(--vvl-accent, #9146ff); }
  50% { border-color: var(--vvl-accent2, #7ecef4); }
}
/* Contour dégradé qui tourne / lumière qui parcourt le contour */
@property --vvl-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.vvl-anim-rotate .vv-live-card::before, .vv-livewin.vvl-anim-rotate::before,
.vvl-anim-scan .vv-live-card::before, .vv-livewin.vvl-anim-scan::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; padding: max(var(--vvl-bw, 1px), 1px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: vvlSpin var(--vvl-speed, 4s) linear infinite;
}
.vvl-anim-rotate .vv-live-card::before, .vv-livewin.vvl-anim-rotate::before {
  background: conic-gradient(from var(--vvl-a), var(--vvl-accent, #9146ff), var(--vvl-accent2, #7ecef4), var(--vvl-accent, #9146ff));
}
.vvl-anim-scan .vv-live-card::before, .vv-livewin.vvl-anim-scan::before {
  background: conic-gradient(from var(--vvl-a), transparent 0 75%, var(--vvl-accent2, #7ecef4) 88%, #fff 90%, transparent 92%);
}
.vvl-anim-rotate .vv-live-card, .vvl-anim-scan .vv-live-card,
.vv-livewin.vvl-anim-rotate, .vv-livewin.vvl-anim-scan { border-color: transparent; }
@keyframes vvlSpin { to { --vvl-a: 360deg; } }

/* Fenêtre flottante */
.vv-livewin { background: var(--vvl-card, var(--card, #0d0f18)); border: var(--vvl-bw, 1px) solid var(--vvl-accent, var(--border, rgba(58,159,213,.25))); border-radius: var(--vvl-r, 8px); isolation: isolate; }
.vv-livewin-title { font-family: var(--vvl-font, var(--vvt-font-titres, var(--font-display, 'Rajdhani', 'Open Sans', sans-serif))); color: var(--vvl-title-c, #fff); }
.vv-livewin-meta { color: var(--vvl-meta, var(--muted, #6b7295)); }
.vv-livewin-bar .vv-live-badge { font-size: 10px; padding: 2px 6px; }
.vv-livewin.vvl-bar-accent .vv-livewin-bar { background: var(--vvl-accent, #9146ff); }
.vv-livewin.vvl-bar-gradient .vv-livewin-bar { background: linear-gradient(90deg, var(--vvl-accent, #9146ff), var(--vvl-accent2, #7ecef4)); }
.vv-livewin.vvl-bar-accent .vv-livewin-meta, .vv-livewin.vvl-bar-gradient .vv-livewin-meta { color: rgba(255,255,255,.85); }

/* Faux direct (aperçu de l'administration) */
.vv-live-fake {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--vvl-accent, #9146ff) 45%, #000), #05060a 70%);
  color: rgba(255,255,255,.75); font: 600 14px var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif));
}
.vv-live-fake-play { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: rgba(255,255,255,.12); color: #fff; }
.vv-live-fake-chat { height: 100%; padding: 10px 12px; background: #18181b; color: #efeff1; font: 13px/1.5 var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif)); overflow: hidden; }
.vv-live-fake-chat p { margin: 0 0 8px; }
.vv-live-fake-chat b { color: var(--vvl-accent2, #7ecef4); margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
  .vv-live-card, .vv-live-card::before, .vv-livewin, .vv-livewin::before, .vv-live-badge { animation: none !important; }
}
@media (max-width: 900px) { .vv-live-grid.has-chat { grid-template-columns: 1fr; } }

/* 2.0.0 : bandeau repliable (« – » : fenêtre flottante à la place ; barre « Afficher le direct » sans fenêtre possible) */
.vv-live-head { position: relative; }
.vv-live-fold {
  margin-left: auto; width: 32px; height: 28px; padding: 0; border: 1px solid var(--border, rgba(255,255,255,.18));
  border-radius: 6px; background: rgba(0,0,0,.35); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.vv-live-fold:hover, .vv-live-fold:focus-visible { background: rgba(255,255,255,.1); border-color: var(--vvl-accent, #9146ff); outline: none; }
.vv-live-unfold {
  margin-left: auto; padding: 6px 12px; border: 1px solid var(--vvl-accent, #9146ff); border-radius: 6px;
  background: transparent; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;
}
.vv-live.is-folded { padding-bottom: 16px; }
.vv-live.is-folded .vv-live-grid, .vv-live.is-folded .vv-live-meta, .vv-live.is-folded .vv-live-link { display: none; }
.vv-live.is-folded .vv-live-head { margin-bottom: 0; }
.vv-livewin-btn[hidden], .vv-live-fold[hidden], .vv-live-unfold[hidden] { display: none; }
/* Boutons : rôle « Boutons » de Réglages › Polices (2.4.0) */
.vv-live-link, .vv-livewin-btn, .vv-live-fold, .vv-live-unfold { font-family: var(--vvt-font-boutons, var(--vvt-font-texte, var(--font-ui, 'Open Sans', sans-serif))); }
@media (prefers-reduced-motion: no-preference) {
  .vv-live:not([hidden]) .vv-live-card { animation: vvLiveIn .25s ease-out; }
  @keyframes vvLiveIn { from { opacity: .4; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
