/* =====================================================================
   NeuroForge — nf-ambiente.css  (AGENTE AMBIENTE)
   Escena de fondo "gamer" reutilizable para el lado alumno + selección
   de personaje + acompañante. Úsalo junto a nf-ui.css y nf-ambiente.js.

   Uso mínimo en una página:
     <link rel="stylesheet" href="/assets/nf-ambiente.css">
     <script src="/assets/nf-ambiente.js" defer></script>
     <body class="ui" data-ambiente="lobby|juego|celebracion">
   Opcional: data-ambiente-arte="security-world.webp" (imagen de la escena).
   Se apaga solo con prefers-reduced-motion o "Menos movimiento" (nf_calma):
   queda la imagen fija, sin video, sin partículas y sin animaciones.
   ===================================================================== */

:root {
  --nfx-hue: 178, 107, 255;          /* acento de la escena (rgb) */
  --nfx-art-op: .42;                 /* opacidad del arte/video */
  --nfx-dim: .55;                    /* oscurecido general (legibilidad) */
  --nfx-floor-op: .5;
}

/* ---------- Capa de escena ----------
   Regla: cada capa ocupa exactamente el viewport (inset:0) y recorta (overflow:hidden).
   Lo que se agranda, rota o se desplaza vive en su ::before, así ningún elemento
   medible pasa de 100vw (sin scroll horizontal ni falsos positivos en 390px). */
.nfx-amb { position: fixed; inset: 0; z-index: -1; overflow: hidden; overflow: clip; pointer-events: none; contain: strict; background: var(--ui-bg, #0e0c14); }
.nfx-amb > * { position: absolute; inset: 0; overflow: hidden; }
.nfx-art, .nfx-fog, .nfx-light, .nfx-floor { --nfx-px: 0px; --nfx-py: 0px; }
.nfx-art::before, .nfx-fog::before, .nfx-light::before, .nfx-light::after, .nfx-floor::before { content: ''; position: absolute; translate: var(--nfx-px) var(--nfx-py); }
/* Arte (imagen de la escena) */
.nfx-art { opacity: var(--nfx-art-op); transition: opacity .8s var(--ui-ease, ease); }
.nfx-art::before { inset: 0; background: var(--nfx-art-img, none) center 30% / cover no-repeat; transform: scale(1.08); }
.nfx-vid { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: 0; transition: opacity 1s var(--ui-ease, ease); }
.nfx-amb.has-vid .nfx-vid { opacity: var(--nfx-art-op); }
.nfx-amb.has-vid .nfx-art { opacity: 0; }
/* Niebla de color: dos manchas suaves que respiran */
.nfx-fog { opacity: .9; }
.nfx-fog::before { inset: -20%; background:
    radial-gradient(40% 35% at 22% 30%, rgba(var(--nfx-hue), .20), transparent 70%),
    radial-gradient(38% 32% at 80% 72%, rgba(99, 102, 241, .14), transparent 70%); }
/* Haces de luz desde arriba (profundidad; muy tenues, nada de neón) */
.nfx-light { opacity: var(--nfx-light-op, .8); mix-blend-mode: screen; }
.nfx-light::before, .nfx-light::after { top: -10%; height: 90%; width: 34%; transform-origin: 50% 0;
  background: linear-gradient(to bottom, rgba(var(--nfx-hue), .10), rgba(var(--nfx-hue), .03) 55%, transparent 85%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); }
.nfx-light::before { left: 8%; transform: rotate(16deg); }
.nfx-light::after { left: 56%; width: 26%; transform: rotate(-12deg); background: linear-gradient(to bottom, rgba(213, 179, 255, .07), rgba(213, 179, 255, .02) 55%, transparent 85%); }
/* Suelo en perspectiva (rejilla) + línea de horizonte */
.nfx-floor { top: auto; height: 46%; perspective: 520px; perspective-origin: 50% 0; opacity: var(--nfx-floor-op);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.nfx-floor::before { left: -50%; right: -50%; top: 0; height: 200%; transform-origin: 50% 0; transform: rotateX(62deg);
  background-image:
    linear-gradient(rgba(var(--nfx-hue), .38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--nfx-hue), .30) 1px, transparent 1px);
  background-size: 64px 64px; }
.nfx-pts { width: 100%; height: 100%; }
/* Destello de celebración (desde abajo) */
.nfx-burst { opacity: 0; background:
    radial-gradient(60% 45% at 50% 100%, rgba(74, 222, 128, .22), transparent 70%),
    radial-gradient(45% 40% at 50% 0%, rgba(251, 191, 36, .14), transparent 70%);
  transition: opacity .5s var(--ui-ease, ease); }
/* Viñeta + oscurecido: mantiene el contraste AA del contenido */
.nfx-vig { background:
    radial-gradient(120% 90% at 50% 45%, rgba(14, 12, 20, calc(var(--nfx-dim) - .25)) 0%, rgba(14, 12, 20, calc(var(--nfx-dim) + .2)) 70%, rgba(14, 12, 20, .96) 100%),
    linear-gradient(to bottom, rgba(14, 12, 20, .55), transparent 18%, transparent 75%, rgba(14, 12, 20, .7)); }

/* ---------- Variantes ---------- */
body[data-ambiente="lobby"]       { --nfx-art-op: .42; --nfx-dim: .46; --nfx-floor-op: .55; --nfx-light-op: .9; }
body[data-ambiente="juego"]       { --nfx-art-op: .16; --nfx-dim: .72; --nfx-floor-op: .22; --nfx-light-op: .4; }
body[data-ambiente="celebracion"] { --nfx-art-op: .24; --nfx-dim: .6; --nfx-floor-op: .45; --nfx-light-op: 1; }
body[data-ambiente="celebracion"] .nfx-burst { opacity: 1; }
body[data-ambiente="off"] .nfx-amb { display: none; }
@media (max-width: 767px) { body[data-ambiente="lobby"] { --nfx-art-op: .34; } }
/* Variante "suave" para páginas de lectura (aula, jugar) */
body[data-ambiente="suave"]       { --nfx-art-op: .22; --nfx-dim: .66; --nfx-floor-op: .3; --nfx-light-op: .55; }

/* Movimiento (solo si no hay calma). Todo son transform/opacity en capas compuestas. */
@keyframes nfx-drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(3%, -2%, 0) scale(1.06); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
@keyframes nfx-floor { from { transform: rotateX(62deg) translate3d(0, 0, 0); } to { transform: rotateX(62deg) translate3d(0, 64px, 0); } }
@keyframes nfx-art { 0%, 100% { transform: scale(1.08); } 50% { transform: scale(1.12) translate3d(-1%, 0, 0); } }
@keyframes nfx-beam { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.nfx-amb.is-moving .nfx-fog::before { animation: nfx-drift 26s ease-in-out infinite; will-change: transform; }
.nfx-amb.is-moving .nfx-floor::before { animation: nfx-floor 4s linear infinite; will-change: transform; }
body[data-ambiente="juego"] .nfx-amb.is-moving .nfx-floor::before,
body[data-ambiente="suave"] .nfx-amb.is-moving .nfx-floor::before { animation-duration: 12s; }
.nfx-amb.is-moving .nfx-art::before { animation: nfx-art 40s ease-in-out infinite; will-change: transform; }
.nfx-amb.is-moving .nfx-light::before { animation: nfx-beam 11s ease-in-out infinite; }
.nfx-amb.is-moving .nfx-light::after { animation: nfx-beam 14s ease-in-out -5s infinite; }
/* Pestaña oculta: nada corre */
.nfx-amb.is-paused *, .nfx-amb.is-paused *::before, .nfx-amb.is-paused *::after { animation-play-state: paused !important; }
.nfx-amb.is-calm .nfx-pts, .nfx-amb.is-calm .nfx-vid { display: none; }
@media (prefers-reduced-motion: reduce) { .nfx-amb *, .nfx-amb *::before, .nfx-amb *::after, .nfx-amb { animation: none !important; } }
/* Celulares: sin mezcla de capas para la luz (más barata) */
@media (max-width: 767px), (pointer: coarse) { .nfx-light { mix-blend-mode: normal; } }

/* Las tarjetas de la página dejan ver la escena alrededor sin perder legibilidad */
body[data-ambiente] .ui-header { background: rgba(14, 12, 20, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* =====================================================================
   Selección de personaje (entrada de la sala)  — .nfx-join
   Zonas: top (marca) · stage (personaje) · info (nombre/estadísticas)
          · pick (plantel) · form (código, nombre, entrar)
   ===================================================================== */
.nfx-join { --nfx-pad: 16px; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "stage" "info" "pick" "form"; align-content: start; gap: 0;
  padding: 0 var(--nfx-pad) calc(88px + env(safe-area-inset-bottom, 0px)); max-width: 1320px; margin: 0 auto; }
.nfx-join.hidden { display: none; }
.nfx-join-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.nfx-join-top .ui-brand { text-decoration: none; }

/* Escenario */
.nfx-stage { grid-area: stage; position: relative; height: clamp(250px, 38vh, 330px); display: flex; align-items: flex-end; justify-content: center; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.nfx-stage::before { content: ''; position: absolute; left: 50%; bottom: 0; width: min(520px, 100%); height: 100%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(14, 12, 20, .62), rgba(14, 12, 20, .25) 60%, transparent); pointer-events: none; }
.nfx-stage-light { position: absolute; left: 50%; top: -40px; width: min(360px, 90%); height: calc(100% + 30px); transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(var(--nfx-hue), .26), rgba(var(--nfx-hue), .06) 70%, transparent);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); filter: blur(6px); opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%); mask-image: linear-gradient(to bottom, transparent, #000 22%); }
.nfx-plat { position: absolute; left: 50%; bottom: 2px; width: min(280px, 74%); aspect-ratio: 4 / 1; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--nfx-hue), .38), rgba(var(--nfx-hue), .08) 70%, transparent);
  box-shadow: inset 0 0 0 2px rgba(var(--nfx-hue), .55), inset 0 0 0 7px rgba(14, 12, 20, .55), inset 0 0 0 8px rgba(var(--nfx-hue), .25); }
.nfx-plat::after { content: ''; position: absolute; inset: 22% 18%; border-radius: 50%; box-shadow: 0 0 0 1px rgba(var(--nfx-hue), .35); }
.nfx-hero { position: relative; z-index: 1; height: 92%; max-width: 80%; object-fit: contain; margin-bottom: 4%;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .6)); transform-origin: 50% 100%;
  transition: opacity .2s var(--ui-ease), transform .26s var(--ui-ease); }
.nfx-hero.out-l { opacity: 0; transform: translateX(-36px) scale(.96); }
.nfx-hero.out-r { opacity: 0; transform: translateX(36px) scale(.96); }
.nfx-hero.in-l  { opacity: 0; transform: translateX(36px) scale(.96); transition: none; }
.nfx-hero.in-r  { opacity: 0; transform: translateX(-36px) scale(.96); transition: none; }
@keyframes nfx-idle { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.nfx-moving .nfx-hero { animation: nfx-idle 3.6s ease-in-out infinite; }
.nfx-stage-nav { position: absolute; z-index: 2; top: 46%; width: 44px; height: 44px; border-radius: 50%; padding: 0;
  background: rgba(21, 18, 29, .72); border: 1px solid var(--ui-border-strong); color: var(--ui-text); }
.nfx-stage-nav:hover { background: var(--ui-surface-3); }
.nfx-stage-nav.prev { left: 0; } .nfx-stage-nav.next { right: 0; }
.nfx-stage-count { position: absolute; z-index: 2; top: 6px; right: 0; font: 600 var(--ui-fs-xs)/1 var(--ui-font-mono); color: var(--ui-text-3); }

/* Ficha del agente */
.nfx-info { grid-area: info; display: grid; gap: 10px; padding: 10px 0 4px; text-align: center; justify-items: center; }
.nfx-world { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(var(--nfx-hue), .14); color: var(--ui-accent-text); font-size: var(--ui-fs-xs); font-weight: 600; }
.nfx-world .ui-icon { font-size: 16px; }
.nfx-name { margin: 0; font: 700 34px/1 var(--ui-font-display); letter-spacing: -.02em; color: var(--ui-text); }
.nfx-role { margin: -4px 0 0; color: var(--ui-text-2); font-weight: 600; font-size: var(--ui-fs-md); }
.nfx-bio { display: none; margin: 0; color: var(--ui-text-2); max-width: 40ch; }
.nfx-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 360px; }
.nfx-stat { display: grid; gap: 5px; text-align: left; }
.nfx-stat-l { display: flex; justify-content: space-between; font-size: var(--ui-fs-xs); color: var(--ui-text-2); }
.nfx-stat-l b { font: 600 var(--ui-fs-xs) var(--ui-font-mono); color: var(--ui-text); }
.nfx-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.nfx-bar i { height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .1); transition: background .25s var(--ui-ease), transform .25s var(--ui-ease); }
.nfx-bar i.on { background: rgb(var(--nfx-hue)); }
.nfx-stat-note { display: none; margin: 0; font-size: var(--ui-fs-xs); color: var(--ui-text-3); }

/* Plantel */
.nfx-pick { grid-area: pick; display: grid; gap: 8px; padding: 12px 0 4px; }
.nfx-pick-head { display: flex; align-items: baseline; justify-content: space-between; }
.nfx-pick-head .ui-label { margin: 0; }
.nfx-roster { display: grid; grid-auto-flow: column; grid-auto-columns: 64px; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 4px; margin: 0 -2px; }
.nfx-roster::-webkit-scrollbar { display: none; }
.nfx-ag { position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 2px; height: 84px; padding: 4px 2px 5px; scroll-snap-align: start;
  border-radius: var(--ui-radius); border: 1px solid var(--ui-border-strong); background: rgba(28, 24, 38, .82); color: var(--ui-text-2); cursor: pointer; font: inherit; overflow: hidden;
  transition: border-color .15s, background .15s, transform .18s var(--ui-ease); }
.nfx-ag::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: 18px; height: 14px; border-radius: 50%; background: rgba(var(--ag-hue, var(--nfx-hue)), .25); filter: blur(4px); opacity: 0; transition: opacity .2s; }
.nfx-ag img { position: relative; height: 56px; width: 100%; object-fit: contain; object-position: bottom; transition: transform .2s var(--ui-ease); }
.nfx-ag span { position: relative; font: 600 11px/1.1 var(--ui-font-display); white-space: nowrap; }
.nfx-ag:hover { border-color: rgba(var(--ag-hue, var(--nfx-hue)), .6); }
.nfx-ag:hover img { transform: translateY(-2px); }
.nfx-ag:active { transform: scale(.96); }
.nfx-ag[aria-checked="true"] { border-color: rgb(var(--ag-hue, var(--nfx-hue))); background: rgba(var(--ag-hue, var(--nfx-hue)), .16); color: var(--ui-text); box-shadow: inset 0 0 0 1px rgb(var(--ag-hue, var(--nfx-hue))); transform: translateY(-3px); }
.nfx-ag[aria-checked="true"]::before { opacity: 1; }
.nfx-ag[aria-checked="true"] img { transform: scale(1.1) translateY(-2px); }
@keyframes nfx-sel { 0% { transform: translateY(0) scale(.94); } 60% { transform: translateY(-5px) scale(1.04); } 100% { transform: translateY(-3px) scale(1); } }
.nfx-ag.just { animation: nfx-sel .34s var(--ui-ease); }

/* Formulario */
.nfx-form { grid-area: form; display: grid; gap: 14px; padding-top: 12px; }
.nfx-form-head h1 { margin: 0; font-size: var(--ui-fs-xl); }
.nfx-form-head p { display: none; }
.nfx-form .ui-field { margin: 0; }
.nfx-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--ui-radius-lg); border: 1px solid var(--ui-border); background: rgba(21, 18, 29, .86); overflow: hidden; min-height: 60px; }
.nfx-card > *:not(.g-banner-bg) { position: relative; }
.nfx-card .g-av { --av: 40px; flex: none; }
.nfx-card-txt { min-width: 0; flex: 1; display: grid; gap: 1px; }
.nfx-card-txt small { font-size: var(--ui-fs-xs); color: var(--ui-text-3); }
.nfx-card-txt b { font: 600 var(--ui-fs-lg)/1.2 var(--ui-font-display); color: var(--ui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfx-card-txt b.is-ph { color: var(--ui-text-3); font-weight: 500; }
.nfx-card a { font-size: var(--ui-fs-xs); color: var(--ui-accent-text); text-decoration: none; flex: none; padding: 12px 4px; }
.nfx-card a:hover { text-decoration: underline; }
.nfx-go { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px var(--nfx-pad) calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(14, 12, 20, .97) 60%, rgba(14, 12, 20, 0)); display: grid; gap: 6px; }
.nfx-go .ui-btn { height: 52px; font-size: var(--ui-fs-lg); }

/* Escritorio: personaje al centro, ficha a la izquierda, formulario a la derecha */
@media (min-width: 960px) {
  .nfx-join { --nfx-pad: 32px; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) minmax(360px, 400px); grid-template-rows: 64px minmax(0, 1fr) auto;
    grid-template-areas: "top top top" "info stage form" "pick pick form"; column-gap: 24px; padding-bottom: 28px; align-content: stretch; }
  .nfx-stage { height: auto; min-height: 400px; }
  .nfx-hero { height: min(56vh, 470px); }
  .nfx-plat { width: min(380px, 80%); }
  .nfx-stage-light { width: min(520px, 100%); }
  .nfx-stage-nav.prev { left: 4%; } .nfx-stage-nav.next { right: 4%; }
  .nfx-info { align-content: center; justify-items: start; text-align: left; gap: 12px; padding: 0; }
  .nfx-name { font-size: 52px; }
  .nfx-role { font-size: var(--ui-fs-lg); }
  .nfx-bio { display: block; }
  .nfx-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 260px; margin-top: 6px; }
  .nfx-bar i { height: 8px; }
  .nfx-stat-note { display: block; }
  .nfx-pick { grid-column: 1 / 3; justify-self: center; width: min(640px, 100%); padding: 8px 0 0; }
  .nfx-roster { grid-auto-columns: minmax(0, 1fr); overflow: visible; }
  .nfx-ag { height: 108px; }
  .nfx-ag img { height: 74px; }
  .nfx-ag span { font-size: 12px; }
  .nfx-form { align-self: center; padding: 24px; border-radius: var(--ui-radius-lg); background: rgba(21, 18, 29, .9); border: 1px solid var(--ui-border-strong); box-shadow: var(--ui-shadow-pop); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .nfx-form-head h1 { margin: 0 0 4px; font-size: var(--ui-fs-3xl); }
  .nfx-form-head p { display: block; margin: 0; }
  .nfx-go { position: static; padding: 0; background: none; }
}
@media (min-width: 960px) and (max-height: 760px) {
  .nfx-hero { height: 48vh; } .nfx-stage { min-height: 330px; } .nfx-ag { height: 92px; } .nfx-ag img { height: 62px; } .nfx-name { font-size: 44px; }
}
/* Teléfonos bajos: aprieta el escenario */
@media (max-width: 959px) and (max-height: 720px) { .nfx-stage { height: 220px; } .nfx-name { font-size: 28px; } }

/* =====================================================================
   Lobby: tu agente grande + compañeros como fila de personajes
   ===================================================================== */
@media (min-width: 1024px) { .sl-stage.nfx-lobby { background: rgba(21, 18, 29, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); } }
.nfx-lobby-hero { position: relative; width: 200px; height: 200px; display: flex; align-items: flex-end; justify-content: center; margin: -4px auto 4px; }
.nfx-lobby-hero .nfx-plat { width: 180px; bottom: 0; }
.nfx-lobby-hero .nfx-stage-light { top: -20px; height: 230px; width: 220px; }
.nfx-lobby-hero img.nfx-hero { height: 190px; margin-bottom: 8px; }
.nfx-lobby-hero .g-level-num { position: absolute; z-index: 2; right: 18px; bottom: 18px; box-shadow: 0 0 0 3px var(--ui-bg); }
.nfx-lobby-hero .g-title { position: absolute; z-index: 2; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; }
@media (min-width: 1024px) { .nfx-lobby-hero { width: 240px; height: 250px; } .nfx-lobby-hero img.nfx-hero { height: 236px; } .nfx-lobby-hero .nfx-plat { width: 220px; } .nfx-lobby-hero .nfx-stage-light { height: 280px; width: 280px; } }

.sl-roster.nfx-crew { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 14px 8px; align-items: end; }
.sl-roster.nfx-crew li { position: relative; gap: 2px; padding-top: 2px; }
/* Cada compañero de pie sobre su pedestal; el marco equipado (NFG.avatarHTML) se vuelve el anillo del pedestal */
ul.sl-roster.nfx-crew .g-av { --av: 52px !important; --gap: 0px !important; width: 58px; height: 80px; }
ul.sl-roster.nfx-crew .g-av-img { top: 0; left: 0; width: 100%; height: calc(100% - 7px); border: 0; border-radius: 0; background: none; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
ul.sl-roster.nfx-crew .g-av-fr { inset: auto 3px 0 3px; height: 15px; z-index: 0; }
ul.sl-roster.nfx-crew .g-fr-ninguno .g-av-fr { background: rgba(var(--nfx-hue), .2); box-shadow: inset 0 0 0 1px rgba(var(--nfx-hue), .38); }
ul.sl-roster.nfx-crew li.is-me .g-fr-ninguno .g-av-fr { background: rgba(var(--nfx-hue), .45); box-shadow: inset 0 0 0 1.5px rgb(var(--nfx-hue)); }
/* Respaldo si el plantel llega con <img> simple */
ul.sl-roster.nfx-crew li img:not(.g-av-img) { position: relative; width: 52px; height: 72px; border: 0; border-radius: 0; background: none; object-fit: contain; object-position: bottom; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
ul.sl-roster.nfx-crew li.is-me img:not(.g-av-img) { border: 0; }
ul.sl-roster.nfx-crew .more { width: 52px; height: 52px; margin-bottom: 14px; }
@keyframes nfx-drop { 0% { opacity: 0; transform: translateY(-18px) scale(.9); } 60% { opacity: 1; transform: translateY(3px) scale(1.03); } 100% { transform: none; } }
.sl-roster.nfx-crew li.is-new { animation: nfx-drop .5s var(--ui-ease) both; }

/* =====================================================================
   Acompañante: mini junto a la meta + reacción al revelar
   ===================================================================== */
.nfx-mini { position: relative; flex: none; width: 26px; height: 30px; display: inline-flex; align-items: flex-end; justify-content: center; }
.nfx-mini img { height: 30px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); transform-origin: 50% 100%; }
.sl-goal.has-buddy > .ui-icon:first-child { display: none; }
@keyframes nfx-hop { 0%, 100% { transform: none; } 35% { transform: translateY(-7px) rotate(-6deg); } 70% { transform: translateY(-2px) rotate(4deg); } }
@keyframes nfx-sad { 0%, 100% { transform: none; } 25% { transform: translateX(-3px) rotate(-4deg); } 60% { transform: translateX(3px) rotate(3deg); } }
.nfx-mini.is-ok img { animation: nfx-hop .7s var(--ui-ease) 2; }
.nfx-mini.is-bad img { animation: nfx-sad .6s ease 1; }

.nfx-buddy { position: fixed; z-index: 60; left: 12px; bottom: calc(var(--sl-bar, 0px) + 10px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: flex-end; gap: 6px; pointer-events: none;
  opacity: 0; transform: translateY(40px); transition: opacity .25s var(--ui-ease), transform .35s cubic-bezier(.2, 1.5, .4, 1); }
.nfx-buddy.show { opacity: 1; transform: none; }
.nfx-buddy img { height: 104px; width: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6)); transform-origin: 50% 100%; }
.nfx-buddy.is-ok.show img { animation: nfx-hop .7s var(--ui-ease) .15s 2; }
.nfx-buddy.is-bad.show img { animation: nfx-sad .6s ease .15s 1; }
.nfx-bubble { margin-bottom: 64px; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--ui-surface-3); border: 1px solid var(--ui-border-strong); color: var(--ui-text); font: 600 var(--ui-fs-sm)/1.25 var(--ui-font-display); box-shadow: var(--ui-shadow-pop); max-width: 170px; }
.nfx-buddy.is-ok .nfx-bubble { border-color: rgba(74, 222, 128, .45); }
@media (max-width: 1023px) { .nfx-buddy { left: auto; right: 8px; flex-direction: row-reverse; } .nfx-buddy img { height: 92px; } .nfx-bubble { margin-bottom: 56px; border-radius: 12px 12px 4px 12px; max-width: 150px; } }
@media (min-width: 1024px) { .nfx-buddy { left: 24px; bottom: 24px; } .nfx-buddy img { height: 150px; } .nfx-bubble { margin-bottom: 96px; } }

/* Calma: sin animaciones propias */
body.nf-calma .nfx-hero, body.nf-calma .nfx-ag, body.nf-calma .nfx-ag img, body.nf-calma .nfx-buddy { transition: none !important; }
body.nf-calma .nfx-moving .nfx-hero, body.nf-calma .nfx-mini img, body.nf-calma .nfx-buddy img, body.nf-calma .nfx-ag.just, body.nf-calma .sl-roster.nfx-crew li.is-new { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .nfx-hero, .nfx-ag, .nfx-ag img, .nfx-buddy { transition: none !important; }
  .nfx-moving .nfx-hero, .nfx-mini img, .nfx-buddy img, .nfx-ag.just, .sl-roster.nfx-crew li.is-new { animation: none !important; }
}
