/* ==========================================================================
   VAVEL · lanzador «Plataformas VAVEL» de ESCRITORIO (≥ 1024 px)
   Lienzo https://claude.ai/artifact/3sxDqib7EgcA3nkcqzRFPD, aprobado por el
   dueño el 1-oct-2026. Fuente única: /opt/vavel/scripts/shared/vavel-platform-sheet/
   — copiar TAL CUAL (ver README). Todo con prefijo .vpl- (no choca con la hoja
   móvil .vps- ni con los PlatformSheet.tsx de audio y vídeo).

   - Botón: 40 × 40, radio 12, con el ICONO OFICIAL de la app de 32 px. Siempre el
     ÚLTIMO elemento a la derecha de la cabecera. Por debajo de 1024 px no existe
     (allí manda la barra inferior con su hoja).
   - Tooltip = su aria-label, debajo, a los 400 ms.
   - Menú: 456 px, radio 16, 8 px bajo el botón y alineado a su borde derecho. Lo
     pinta vavel-launcher.js en el cliente al abrirlo (no está en el HTML).
   - Tema por atributo: data-vpl-theme="dark" (vídeo, audio, premium, juegos, pay)
     o "light" (images, www).
   ========================================================================== */

/* El icono oficial (assets: vavel-icon.svg): cuadrado redondeado con degradado
   azul, banda curva celeste abajo y la V blanca, recta y gruesa. */
.vpl-ic, .vpl-v {
  display: block; flex: none; width: 32px; height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3ClinearGradient id='a' y2='128' x2='0' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%230088cb'/%3E%3Cstop offset='1' stop-color='%2300578b'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' y1='100' y2='200' x2='0' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2300aee3'/%3E%3Cstop offset='1' stop-color='%230072a9'/%3E%3C/linearGradient%3E%3Crect width='200' height='200' rx='18' fill='url(%23a)'/%3E%3Cpath d='M0 100.5a195 195 0 0 0 200 0V182a18 18 0 0 1-18 18H18A18 18 0 0 1 0 182z' fill='url(%23b)'/%3E%3Cpath d='M38 40h49.5L100 125l12.5-85H162l-26.5 119h-71z' fill='%23fff'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- Botón ---------- */
.vpl-btn {
  --vpl-hover: rgba(255, 255, 255, .12);
  --vpl-ring: #8fb4ec;
  --vpl-tip-bg: #f2f2f2;
  --vpl-tip-ink: #111;
  position: relative; box-sizing: border-box; flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0;
  border: 0; border-radius: 12px; background: transparent; box-shadow: none;
  color: inherit; font: inherit; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vpl-btn[data-vpl-theme="light"] { --vpl-hover: #e3e8f1; --vpl-ring: #2f62c9; --vpl-tip-bg: #111; --vpl-tip-ink: #fff; }
@media (max-width: 1023.98px) { .vpl-btn { display: none !important; } }
.vpl-btn:hover, .vpl-btn[aria-expanded="true"] { background: var(--vpl-hover); }
.vpl-btn[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--vpl-ring); }
.vpl-btn:focus { outline: none; }
.vpl-btn:focus-visible { outline: 2px solid var(--vpl-ring); outline-offset: 2px; }
/* Tooltip con el mismo texto que el aria-label (lo traduce el JS). */
.vpl-btn::after {
  content: attr(aria-label);
  position: absolute; top: 48px; right: 0; z-index: 5;
  padding: 6px 10px; border-radius: 8px; background: var(--vpl-tip-bg); color: var(--vpl-tip-ink);
  font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: normal; text-transform: none; white-space: nowrap;
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility 0s linear .12s;
}
.vpl-btn:hover::after { opacity: 1; visibility: visible; transition: opacity .12s ease .4s, visibility 0s linear .4s; }
.vpl-btn[aria-expanded="true"]::after { display: none; }

/* ---------- Menú (lo crea el JS al abrir; va al final del <body>) ---------- */
.vpl-pop {
  --vpl-panel: #17171a; --vpl-line: #2a2a2f; --vpl-ink: #fff; --vpl-mute: #a1a1aa;
  --vpl-chip: #222226; --vpl-hov: #222226; --vpl-hov-chip: #2c2c31;
  --vpl-row: #222226; --vpl-row-hov: #2a2a2f; --vpl-av: #3a3a40;
  --vpl-cta: #fff; --vpl-cta-ink: #0b0b0c; --vpl-cta-hov: #e9e9ec;
  --vpl-premium: #fbbf24; --vpl-ring: #8fb4ec; --vpl-on-ring: inset 0 0 0 1.5px #8fb4ec;
  --vpl-shadow: 0 18px 48px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
  position: fixed; z-index: 2000; top: 0; right: 0;
  box-sizing: border-box; width: 456px; max-width: calc(100vw - 32px); max-height: calc(100vh - 80px); overflow-y: auto;
  margin: 0; padding: 16px; border: 1px solid var(--vpl-line); border-radius: 16px;
  background: var(--vpl-panel); box-shadow: var(--vpl-shadow); color: var(--vpl-ink);
  display: flex; flex-direction: column; gap: 14px;
  font-size: 14px; font-weight: 400; line-height: 1.25; letter-spacing: normal; text-align: left; text-transform: none;
  animation: vpl-in .16s cubic-bezier(.2, .8, .2, 1);
}
.vpl-pop[data-vpl-theme="light"] {
  --vpl-panel: #fff; --vpl-line: #e3e5e8; --vpl-ink: #111; --vpl-mute: #5f6368;
  --vpl-chip: #f1f3f6; --vpl-hov: #f1f3f6; --vpl-hov-chip: #fff;
  --vpl-row: #f1f3f6; --vpl-row-hov: #e7eaef; --vpl-av: #dfe2e7;
  --vpl-cta: #111; --vpl-cta-ink: #fff; --vpl-cta-hov: #000;
  --vpl-premium: #b45309; --vpl-ring: #2f62c9; --vpl-on-ring: none;
  --vpl-shadow: 0 18px 48px rgba(17, 17, 17, .22), 0 2px 6px rgba(17, 17, 17, .08);
}
@keyframes vpl-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .vpl-pop { animation: none; } }
.vpl-pop *, .vpl-pop *::before, .vpl-pop *::after { box-sizing: border-box; }
.vpl-pop svg { display: block; flex: none; }

.vpl-head { display: flex; align-items: center; gap: 10px; }
.vpl-brand { display: flex; flex-direction: column; min-width: 0; }
.vpl-brand b { font-size: 16px; font-weight: 800; line-height: 1.25; }
.vpl-brand span { font-size: 12px; line-height: 1.3; color: var(--vpl-mute); }

.vpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.vpl-pop a { text-decoration: none; -webkit-tap-highlight-color: transparent; }
.vpl-pop a:focus { outline: none; }
.vpl-pop a:focus-visible { outline: 2px solid var(--vpl-ring); outline-offset: 2px; }
.vpl-pop a.vpl-l {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; border-radius: 12px;
  background: transparent; color: var(--vpl-ink);
}
.vpl-chip {
  width: 40px; height: 40px; border-radius: 10px; flex: none; background: var(--vpl-chip); color: inherit;
  display: flex; align-items: center; justify-content: center;
}
.vpl-chip svg { width: 22px; height: 22px; }
.vpl-l--premium .vpl-chip { color: var(--vpl-premium); }
.vpl-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vpl-name { font-size: 14px; font-weight: 700; line-height: 1.25; }
.vpl-desc { font-size: 12px; line-height: 1.3; color: var(--vpl-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vpl-pop a.vpl-l:not([aria-current]):hover { background: var(--vpl-hov); color: var(--vpl-ink); }
.vpl-pop a.vpl-l:not([aria-current]):hover .vpl-chip { background: var(--vpl-hov-chip); }
/* La plataforma actual: azul marino de VAVEL y «ESTÁS AQUÍ». */
.vpl-pop a.vpl-l[aria-current="page"] { background: #1b3a6b; color: #fff; box-shadow: var(--vpl-on-ring); }
.vpl-pop a.vpl-l[aria-current="page"]:hover { color: #fff; }
.vpl-l[aria-current="page"] .vpl-chip { background: rgba(255, 255, 255, .14); color: #fff; }
.vpl-l[aria-current="page"] .vpl-txt { gap: 3px; }
.vpl-l[aria-current="page"] .vpl-name { font-weight: 800; }
.vpl-here { font-size: 10px; font-weight: 700; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; color: #cfe0fa; white-space: nowrap; }

.vpl-sep { height: 1px; background: var(--vpl-line); flex: none; }
.vpl-pop[data-vpl-theme="light"] .vpl-sep { background: #e3e5e8; }
.vpl-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vpl-pop a.vpl-row, .vpl-pop a.vpl-cta {
  height: 44px; border-radius: 12px; display: flex; align-items: center; min-width: 0;
  font-size: 13px; line-height: 1.2; white-space: nowrap;
}
.vpl-pop a.vpl-row { gap: 8px; padding: 0 6px 0 8px; background: var(--vpl-row); color: var(--vpl-ink); font-weight: 700; }
.vpl-pop a.vpl-row:hover { background: var(--vpl-row-hov); color: var(--vpl-ink); }
.vpl-av {
  width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden; background: var(--vpl-av);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.vpl-av svg { width: 15px; height: 15px; }
.vpl-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vpl-grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vpl-row > svg { width: 16px; height: 16px; stroke: var(--vpl-mute); }
.vpl-pop a.vpl-cta { justify-content: center; gap: 6px; padding: 0 6px; background: var(--vpl-cta); color: var(--vpl-cta-ink); font-weight: 800; }
.vpl-pop a.vpl-cta:hover { background: var(--vpl-cta-hov); color: var(--vpl-cta-ink); }
.vpl-cta svg { width: 16px; height: 16px; }
.vpl-cta span { overflow: hidden; text-overflow: ellipsis; }
