/* ==========================================================================
   VAVEL · barra inferior unificada + selector de plataformas («hoja VAVEL»)
   Opción A del lienzo https://claude.ai/artifact/LCTtUvi4nwpm3RZSMbivYJ
   (aprobada por el dueño el 30-sep-2026). Fuente única:
   /opt/vavel/scripts/shared/vavel-platform-sheet/ — copiar TAL CUAL (ver README).

   - Solo móvil y tableta (< 1024 px): en escritorio la barra no existe.
   - Barra: 64 px + zona segura del iPhone; iconos de trazo 24 px; rótulo
     11 px/600 (activo 700 en blanco/negro, con pastilla 56×30 detrás).
   - Tema por atributo: data-theme="dark" (vídeo, audio, juegos, premium) o
     "light" (www, images). Cada web puede afinar colores con las variables.
   - CLS 0: la barra es fija y la hoja es un <dialog> fuera del flujo. El hueco
     que tapa la barra lo reserva la web con `padding-bottom: var(--vps-h)`.
   ========================================================================== */

.vps-bar, .vps-sheet {
  --vps-h: calc(64px + env(safe-area-inset-bottom, 0px));
  --vps-navy: #1b3a6b;
  --vps-navy-ring: #8fb4ec;
  --vps-here: #cfe0fa;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.vps-bar[data-theme="dark"], .vps-sheet[data-theme="dark"] {
  --vps-bar-bg: rgba(13, 16, 32, .95);
  --vps-bar-line: #242a47;
  --vps-dim: #a3a9c7;
  --vps-on: #fff;
  --vps-pill: rgba(255, 255, 255, .12);
  --vps-scrim: rgba(0, 0, 0, .55);
  --vps-panel: #17171a;
  --vps-panel-line: #2a2a2f;
  --vps-grip: #3a3a40;
  --vps-tile: #222226;
  --vps-ink: #fff;
  --vps-mute: #a1a1aa;
  --vps-avatar: #3a3a40;
  --vps-cta-bg: #fff;
  --vps-cta-ink: #0b0b0c;
  --vps-premium: #fbbf24;
}
.vps-bar[data-theme="light"], .vps-sheet[data-theme="light"] {
  --vps-bar-bg: rgba(255, 255, 255, .94);
  --vps-bar-line: #e3e5e8;
  --vps-dim: #5f6368;
  --vps-on: #111;
  --vps-pill: #eef2f8;
  --vps-scrim: rgba(17, 17, 17, .4);
  --vps-panel: #fff;
  --vps-panel-line: transparent;
  --vps-grip: #d4d7dc;
  --vps-tile: #f1f3f6;
  --vps-ink: #111;
  --vps-mute: #5f6368;
  --vps-avatar: #dfe2e7;
  --vps-cta-bg: #111;
  --vps-cta-ink: #fff;
  --vps-premium: #b45309;
}

/* ---------- Barra ---------- */
.vps-bar { display: none; }
@media (max-width: 1023.98px) {
  .vps-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    box-sizing: border-box; height: var(--vps-h);
    padding: 6px 4px env(safe-area-inset-bottom, 0px);
    background: var(--vps-bar-bg); border-top: 1px solid var(--vps-bar-line);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
}
.vps-it {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  min-width: 0; min-height: 44px; margin: 0; padding: 0; border: 0; background: none;
  color: var(--vps-dim); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.vps-it > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vps-ic { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex: none; }
.vps-ic svg { width: 24px; height: 24px; }
.vps-it[aria-current="page"] { color: var(--vps-on); font-weight: 700; }
.vps-it[aria-current="page"] .vps-ic { background: var(--vps-pill); }
.vps-it:focus-visible, .vps-sheet a:focus-visible, .vps-sheet button:focus-visible {
  outline: 2px solid var(--vps-navy-ring); outline-offset: 2px; border-radius: 12px;
}

/* El ICONO OFICIAL de la app de VAVEL (dueño, 1-oct-2026: «el de la app, no un
   cuadrado azul marino plano»): cuadrado redondeado con degradado azul (más oscuro
   arriba), banda curva celeste abajo y la V blanca, recta y gruesa. Es el mismo
   SVG que vavel-icon.svg y que el botón de escritorio (vavel-launcher.css).
   El marcado antiguo traía una V suelta dentro: se oculta. */
.vps-v {
  width: 26px; height: 26px; flex: none; display: block;
  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;
}
.vps-v > svg { display: none; }
.vps-v--lg { width: 32px; height: 32px; }

/* ---------- Hoja de plataformas (un <dialog> modal) ---------- */
.vps-sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; border: 0;
  width: 100%; max-width: none; max-height: 100dvh; background: transparent; color: var(--vps-ink);
  overflow: visible;
}
.vps-sheet:not([open]) { display: none; }
.vps-sheet::backdrop { background: var(--vps-scrim); }
.vps-panel {
  box-sizing: border-box; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0; background: var(--vps-panel); border-top: 1px solid var(--vps-panel-line);
  display: flex; flex-direction: column; gap: 16px;
  animation: vps-up .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 600px) { .vps-panel { max-width: 440px; margin: 0 auto; } }
@keyframes vps-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vps-panel { animation: none; } }

.vps-grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--vps-grip); }
.vps-head { display: flex; align-items: center; justify-content: space-between; }
.vps-brand { display: flex; align-items: center; gap: 10px; }
.vps-brand b { display: block; font-size: 17px; font-weight: 800; line-height: 1.3; }
.vps-brand small { display: block; font-size: 12px; color: var(--vps-mute); line-height: 1.3; }
.vps-close {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: none; color: var(--vps-mute);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.vps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vps-tile {
  height: 96px; border-radius: 16px; background: var(--vps-tile); color: var(--vps-ink); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 700; line-height: 1.2;
}
.vps-tile svg { width: 28px; height: 28px; }
.vps-tile--premium svg { stroke: var(--vps-premium); }
.vps-tile[aria-current="page"] { background: var(--vps-navy); color: #fff; gap: 6px; font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--vps-navy-ring); }
.vps-sheet[data-theme="light"] .vps-tile[aria-current="page"] { box-shadow: none; }
.vps-tile[aria-current="page"] svg { stroke: #fff; }
.vps-here { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--vps-here); }
.vps-row {
  height: 52px; border-radius: 14px; background: var(--vps-tile); color: var(--vps-ink); text-decoration: none;
  display: flex; align-items: center; gap: 12px; padding: 0 14px; font-size: 14px; font-weight: 700;
}
.vps-row > span:nth-child(2) { flex-grow: 1; }
.vps-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--vps-avatar); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.vps-avatar svg { width: 16px; height: 16px; }
.vps-row > svg { width: 18px; height: 18px; stroke: var(--vps-mute); flex: none; }
.vps-cta {
  height: 52px; border-radius: 14px; background: var(--vps-cta-bg); color: var(--vps-cta-ink); text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 800;
}
.vps-cta svg { width: 18px; height: 18px; }
html.vps-lock, html.vps-lock body { overflow: hidden; }

/* Blindaje: hojas globales del tipo `a:hover { color: … }` (antd en images) o
   `a { text-decoration: underline }` no tiñen ni subrayan la barra ni la hoja. */
.vps-bar a.vps-it, .vps-sheet a { text-decoration: none; }
.vps-bar a.vps-it:hover { color: var(--vps-dim); }
.vps-bar a.vps-it[aria-current="page"]:hover { color: var(--vps-on); }
.vps-sheet a.vps-tile:hover, .vps-sheet a.vps-row:hover { color: var(--vps-ink); }
.vps-sheet a.vps-tile[aria-current="page"]:hover { color: #fff; }
.vps-sheet a.vps-cta:hover { color: var(--vps-cta-ink); }

/* El hueco para que la barra no tape el final de la página (html.vps-on lo pone
   el JS para navegadores sin :has). */
@media (max-width: 1023.98px) {
  body:has(> .vps-bar), html.vps-on body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
