/* Virtual ME v6 — interfaz de vanguardia: la cámara es la interfaz; cristal, tipografía fina y un dock flotante. */
:root { --vx-glass: rgba(9, 12, 24, .52); --vx-line: rgba(255, 255, 255, .09); --vx-txt: #e8ecf5; --vx-dim: #8b93a7;
  --vx-grad: linear-gradient(135deg, #22d3ee 0%, #818cf8 55%, #c084fc 100%); --vx-safe-t: env(safe-area-inset-top, 0px); --vx-safe-b: env(safe-area-inset-bottom, 0px); }

/* la barra antigua queda oculta (sus botones siguen funcionando desde el dock y el menú) */
body.vx .top-bar { display: none !important; }
body.vx .scanner-container { height: 100vh; height: 100dvh; }

/* ── cápsula superior ── */
.vx-top { position: fixed; z-index: 345; top: calc(var(--vx-safe-t) + 12px); left: 12px; right: 12px; height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 16px; border-radius: 999px; background: var(--vx-glass); border: 1px solid var(--vx-line); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06); max-width: 760px; margin: 0 auto; }
.vx-brand { display: flex; align-items: center; gap: .45rem; font-size: .78rem; letter-spacing: .32em; color: var(--vx-txt); user-select: none; }
.vx-brand b { font-weight: 600; }
.vx-brand i { font-style: normal; font-weight: 800; background: var(--vx-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: .2em; }
.vx-pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; }
.vx-pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22d3ee; animation: vx-pulse 2.4s ease-out infinite; will-change: transform, opacity; }
@keyframes vx-pulse { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(3.2); opacity: 0; } }
.vx-id { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .85rem; border-radius: 999px; border: 1px solid rgba(52,211,153,.35); background: rgba(16,185,129,.12);
  color: #a7f3d0; font: 600 .74rem/1 inherit; letter-spacing: .04em; cursor: pointer; transition: all .2s; }
.vx-id-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.vx-id.off { border-color: rgba(148,163,184,.3); background: rgba(148,163,184,.08); color: var(--vx-dim); }
.vx-id.off .vx-id-dot { background: transparent; border: 1.5px solid var(--vx-dim); box-shadow: none; }

/* ── HUD del escáner (solo en la vista AR) ── */
.vx-hud { position: fixed; z-index: 21; pointer-events: none; inset: calc(var(--vx-safe-t) + 78px) 18px calc(var(--vx-safe-b) + 104px); }
.vx-hud > i { position: absolute; width: 26px; height: 26px; border-color: rgba(255,255,255,.55); border-style: solid; border-width: 0; filter: drop-shadow(0 0 4px rgba(34,211,238,.6)); }
.vx-hud .tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 10px; }
.vx-hud .tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 10px; }
.vx-hud .bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 10px; }
.vx-hud .br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 10px; }
.vx-scan { position: absolute; left: 8%; right: 8%; top: 3%; height: 94%; opacity: .55; animation: vx-scan 4.5s ease-in-out infinite; will-change: transform;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.75), transparent) top / 100% 1px no-repeat; }
@keyframes vx-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(99%); } }
body.in-discovery .vx-hud, body.in-discovery .vx-fab, body.vx-guest .vx-hud { display: none; }
@media (prefers-reduced-motion: reduce) { .vx-scan, .vx-pulse, .disc::before { animation: none !important; } }

/* estado del motor como línea técnica discreta */
body.vx .debug-console { position: fixed !important; top: calc(var(--vx-safe-t) + 66px) !important; left: 50% !important; right: auto !important; bottom: auto !important; transform: translateX(-50%);
  background: transparent !important; border: none !important; color: rgba(165,243,252,.72) !important; font: 500 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: .08em; text-transform: uppercase; padding: 0 !important; white-space: nowrap; text-shadow: 0 1px 4px rgba(0,0,0,.8); z-index: 22 !important; }
body.vx.in-discovery .debug-console { display: none; }

/* ── botón flotante: cambiar cámara ── */
.vx-fab { position: fixed; z-index: 335; right: 16px; bottom: calc(var(--vx-safe-b) + 100px); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--vx-line);
  background: var(--vx-glass); color: var(--vx-txt); font-size: 1.05rem; cursor: pointer; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.vx-fab:active { transform: scale(.92); }

/* ── dock inferior ── */
.vx-dock { position: fixed; z-index: 340; left: 50%; transform: translateX(-50%); bottom: calc(var(--vx-safe-b) + 14px); width: min(440px, calc(100vw - 24px)); height: 66px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; border-radius: 26px; background: var(--vx-glass); border: 1px solid var(--vx-line);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07); }
.vx-dock button { position: relative; height: 100%; background: none; border: none; color: var(--vx-dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; font: 600 .62rem/1 inherit; letter-spacing: .06em; transition: color .2s; -webkit-tap-highlight-color: transparent; }
.vx-dock button i { font-size: 1.15rem; transition: transform .2s; }
.vx-dock button span { opacity: .0; transform: translateY(-2px); transition: all .2s; text-transform: uppercase; }
.vx-dock button.on { color: #fff; }
.vx-dock button.on span { opacity: 1; transform: none; }
.vx-dock button.on::after { content: ''; position: absolute; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 8px #22d3ee; }
.vx-dock button:active i { transform: scale(.88); }
.vx-dock .vx-main { margin: 0 auto; width: 52px; height: 52px; border-radius: 18px; background: var(--vx-grad); color: #fff; box-shadow: 0 8px 24px rgba(129,140,248,.45), inset 0 1px 0 rgba(255,255,255,.35); }
.vx-dock .vx-main i { font-size: 1.25rem; }
.vx-dock img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255,255,255,.25); background: #0f172a; }
.vx-badge { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #f43f5e; color: #fff; font: 700 .62rem/17px inherit; text-align: center; box-shadow: 0 0 0 2px rgba(9,12,24,.9); }
body.vx-guest .vx-dock [data-vx="post"], body.vx-guest .vx-dock [data-vx="chat"] { opacity: .35; }

/* ── menú del perfil ── */
.vx-sheet { position: fixed; inset: 0; z-index: 445; background: rgba(2,4,10,.45); display: flex; align-items: flex-end; justify-content: center; animation: vmc-fade .15s ease; }
.vx-sheet-card { width: min(440px, calc(100vw - 24px)); margin-bottom: calc(var(--vx-safe-b) + 92px); border-radius: 26px; padding: .6rem; background: rgba(12,16,30,.88); border: 1px solid var(--vx-line);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 24px 60px rgba(0,0,0,.55); color: var(--vx-txt); }
.vx-me { display: flex; gap: .8rem; align-items: center; padding: .6rem .7rem .8rem; border-bottom: 1px solid var(--vx-line); margin-bottom: .3rem; }
.vx-me img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; padding: 2px; background: var(--vx-grad); }
.vx-me div { display: flex; flex-direction: column; }
.vx-me small { color: var(--vx-dim); font-size: .78rem; }
.vx-sheet-card button, .vx-row-sel { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: .3rem .6rem; width: 100%; padding: .75rem .7rem; border: none; background: none;
  color: var(--vx-txt); font: 500 .92rem/1.2 inherit; text-align: left; border-radius: 16px; cursor: pointer; }
.vx-sheet-card button:hover, .vx-row-sel:hover { background: rgba(255,255,255,.05); }
.vx-sheet-card button i, .vx-row-sel i { color: #a5b4fc; text-align: center; }
.vx-sheet-card button em { grid-column: 2; font-style: normal; font-size: .72rem; color: var(--vx-dim); }
.vx-sheet-card button.danger, .vx-sheet-card button.danger i { color: #fb7185; }
.vx-row-sel select { max-width: 160px; background: rgba(255,255,255,.06) !important; color: var(--vx-txt) !important; border: 1px solid var(--vx-line) !important; border-radius: 10px !important; padding: .35rem .5rem !important; font-size: .78rem !important; height: auto !important; }

/* capas por encima del dock */
body.vx .config-panel { z-index: 420; }
body.vx .notification-container { top: calc(var(--vx-safe-t) + 68px); right: 12px; left: 12px; align-items: center; }
body.vx .toast { max-width: 440px; width: 100%; border-radius: 18px; background: rgba(12,16,30,.9); border: 1px solid var(--vx-line); border-left: 3px solid #22d3ee; backdrop-filter: blur(18px); }

/* ── Discovery de vanguardia ── */
body.vx .disc { top: 0; padding-top: calc(var(--vx-safe-t) + 66px); padding-bottom: calc(var(--vx-safe-b) + 96px); background: #04060d; isolation: isolate; }
body.vx .disc::before { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none; opacity: .9;
  background: radial-gradient(38% 32% at 18% 12%, rgba(34,211,238,.18), transparent 70%), radial-gradient(34% 30% at 86% 18%, rgba(192,132,252,.18), transparent 70%),
              radial-gradient(40% 36% at 60% 92%, rgba(99,102,241,.14), transparent 70%);
  animation: vx-aurora 22s ease-in-out infinite alternate; will-change: transform; }
@keyframes vx-aurora { 0% { transform: translate3d(0,0,0) rotate(0deg); } 50% { transform: translate3d(3%,-2%,0) rotate(6deg); } 100% { transform: translate3d(-3%,2%,0) rotate(-4deg); } }
body.vx .disc-inner { max-width: 640px; padding-top: .6rem; }
body.vx .disc-head { align-items: center; margin-bottom: .2rem; }
body.vx .disc-head h2 { font-size: 1.9rem; font-weight: 300; letter-spacing: -.02em; color: #f1f5f9; }
body.vx .disc-head h2 i { display: none; }
body.vx .disc-head h2::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vx-grad); margin-left: .35rem; transform: translateY(-.6rem); }
body.vx #disc-me { display: none; }
body.vx .disc-vis { font-size: .72rem; padding: .35rem .75rem; border-radius: 999px; background: rgba(255,255,255,.04); }
body.vx .disc-tabs { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: .8rem 0 1rem; padding: 4px; border: 1px solid var(--vx-line); border-radius: 999px;
  background: rgba(10,13,26,.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body.vx .disc-tabs button { border: none; border-radius: 999px; margin: 0; padding: .62rem .3rem; font-size: .82rem; letter-spacing: .02em; color: var(--vx-dim); }
body.vx .disc-tabs button i { margin-right: .3rem; font-size: .8rem; }
body.vx .disc-tabs button.on { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(0,0,0,.25); }
body.vx .vf-top { margin-bottom: .9rem; }
body.vx .vf-new { display: none; }
body.vx .vf-top, body.vx .vf-compose, body.vx .vf-list { max-width: none; }
body.vx .vf-mode { border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--vx-line); }
body.vx .vf-mode button { border-radius: 999px; font-size: .8rem; }
body.vx .vf-compose { border-radius: 22px; background: rgba(255,255,255,.035); border-color: var(--vx-line); }
/* personas con anillo (como historias) */
.vf-people { display: flex; gap: .95rem; overflow-x: auto; padding: .2rem .1rem 1rem; margin-bottom: .2rem; scrollbar-width: none; }
.vf-people::-webkit-scrollbar { display: none; }
.vf-people button { flex: 0 0 auto; width: 68px; background: none; border: none; color: var(--vx-txt); display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: pointer; font-size: .7rem; }
.vf-people .ring { width: 64px; height: 64px; border-radius: 50%; padding: 2.5px; background: var(--vx-grad); box-shadow: 0 6px 18px rgba(129,140,248,.25); }
.vf-people .ring.dim { background: rgba(255,255,255,.18); box-shadow: none; }
.vf-people .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2.5px solid #04060d; background: #0f172a; }
.vf-people .ring.add { position: relative; }
.vf-people .ring.add::after { content: '+'; position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px; border-radius: 50%; background: #0ea5e9; color: #fff; font: 700 15px/20px inherit; text-align: center; border: 2px solid #04060d; }
.vf-people span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cbd5e1; }
body.vx .vp-card { border-bottom-color: rgba(255,255,255,.06); }
body.vx .vp-media, body.vx .vp-link { border-radius: 18px; }
body.vx .vx-grid { gap: 4px; }
body.vx .vx-tile { border-radius: 10px; }
@media (min-width: 900px) {
  .vx-top { left: 24px; right: 24px; }
  body.vx .disc-inner { max-width: 680px; }
}

/* Modo liviano (teléfonos de gama baja): sin desenfoque ni animaciones sobre el video */
body.vx-lite .vx-top, body.vx-lite .vx-dock, body.vx-lite .vx-fab, body.vx-lite .vx-sheet-card, body.vx-lite .disc-tabs { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(9,12,24,.86); }
body.vx-lite .vx-scan, body.vx-lite .vx-pulse::after, body.vx-lite .disc::before { animation: none !important; }

/* ── Rendimiento sobre la cámara (v6.1) ──
   El desenfoque de fondo (backdrop-filter) sobre video en vivo obliga a recalcularlo en cada cuadro: en Android baja todo a pocos fps.
   En la vista AR se usa cristal "sólido" (mismo look, sin desenfoque) y el HUD queda estático. El desenfoque solo vive en Discovery. */
body.vx:not(.in-discovery) .vx-top, body.vx:not(.in-discovery) .vx-dock, body.vx .vx-fab {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(8, 11, 22, .8); }
body.vx .vx-scan { display: none; }
body.vx .vx-pulse::after { animation-iteration-count: 3; }
body.vx .vx-hud > i { filter: none; }

/* ── Tarjetas AR (v6.6): el nombre y el @ siempre se leen completos; sin desenfoque (se mueven fluidas) ── */
body.vx .vmcard { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(11, 17, 32, .94); padding-top: 2.15rem; }
body.vx .vmcard.mode-icon { background: none; padding: 0; }
body.vx .vmcard-tools { position: absolute; top: .4rem; right: .5rem; gap: .1rem; }
body.vx .vmcard-tools button { width: 26px; height: 26px; font-size: .7rem; background: transparent; color: #94a3b8; }
body.vx .vmcard-tools button:hover, body.vx .vmcard-tools button:active { background: rgba(255,255,255,.08); color: #fff; }
body.vx .vmcard-head { align-items: flex-start; }
body.vx .vmcard-id strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 1.05rem; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
body.vx .vmcard-id small { white-space: normal; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.25; margin-top: .1rem; }
body.vx .vmcard.mode-compact { padding-top: 2rem; }

/* v7.6: tarjeta AR más translúcida (deja ver la cara detrás); el texto conserva el contraste con una sombra suave */
body.vx .vmcard { background: rgba(11, 17, 32, .70); }
body.vx .vmcard.mode-compact { background: rgba(11, 17, 32, .78); }
body.vx .vmcard :is(h3, strong, small, span, p) { text-shadow: 0 1px 3px rgba(0, 0, 0, .65); }
/* la burbuja mini se arrastra con el dedo (sin desplazar la página) */
.vmcard.mode-icon { touch-action: none; cursor: grab; }
.vmcard.mode-icon.dragging { cursor: grabbing; }

/* logo V+M junto al nombre */
.vx-brand .vx-logo { width: 26px; height: 26px; border-radius: 8px; box-shadow: 0 2px 10px rgba(99,102,241,.45); flex: 0 0 auto; }
