/* =====================================================================
   NeuroForge — nf-fx.css  · estilos de window.NFX (assets/nf-fx.js)
   Usa solo tokens de nf-ui.css (--ui-*) y de nf-game.css (--g-*), con respaldo.
   Movimiento: solo transform/opacity (compositor). Calma / reduced-motion: sin desplazamientos.
   Variables de ajuste por página:
     --fx-rx-bottom   alto de la barra inferior (carril de reacciones y contador)   [88px]
     --fx-toast-top   distancia del aviso de racha al borde superior                [72px]
     --fx-rv-h        alto de las columnas de la revelación vertical                [340px]
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- (a) Reacciones ---------- */
.fx-rx { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; contain: strict; }
.fx-rx-i { position: absolute; left: 0; bottom: var(--fx-rx-bottom, 88px); opacity: 0; line-height: 1; user-select: none;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.fx-rx-i.on { will-change: transform, opacity; }
.fx-rx-tally { position: fixed; z-index: 81; right: 12px; bottom: calc(var(--fx-rx-bottom, 88px) + 8px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 6px; pointer-events: none; opacity: 0; transform: translateY(6px);
  transition: opacity .2s var(--ui-ease, ease), transform .2s var(--ui-ease, ease); }
.fx-rx-tally.show { opacity: 1; transform: none; }
.fx-rx-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px;
  background: rgba(21, 18, 29, .92); border: 1px solid var(--ui-border-strong, rgba(255,255,255,.13)); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.fx-rx-e { font-size: 18px; line-height: 1; }
.fx-rx-chip b { font: 600 13px/1 var(--ui-font-mono, monospace); font-variant-numeric: tabular-nums; color: var(--ui-text, #ece8f3); }

/* ---------- (b) Medidor de energía ---------- */
.fx-hype { --hc: #8b7fa3; --ht: var(--ui-text-2, #a9a1b7); display: grid; gap: 8px; min-width: 0; }
.fx-hype-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-hype-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ui-surface-3, #252033); color: var(--ht); transition: background-color .3s, color .3s; }
.fx-hype-ico .ui-icon { font-size: 17px; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.fx-hype-l { font-size: var(--ui-fs-sm, 13px); color: var(--ui-text-2, #a9a1b7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-hype-s { margin-left: auto; font: 700 var(--ui-fs-md, 14px)/1 var(--ui-font-display, sans-serif); color: var(--ht); white-space: nowrap; display: inline-block; }
.fx-hype-bar { position: relative; height: 10px; border-radius: 999px; background: var(--ui-surface-3, #252033); overflow: hidden; }
.fx-hype-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--hc); border-radius: inherit;
  transition: transform .45s var(--ui-ease, ease), background-color .3s; }
/* segmentos: 10 tramos con separadores del color de la superficie */
.fx-hype-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--fx-hype-gap, var(--ui-surface-1, #15121d)) calc(10% - 2px) 10%); }
.fx-hype.is-s1 { --hc: var(--ui-accent, #b26bff); --ht: var(--ui-accent-text, #d5b3ff); }
.fx-hype.is-s2 { --hc: var(--g-gold, #fbbf24); --ht: var(--g-gold, #fbbf24); }
.fx-hype.is-s3 { --hc: var(--g-fire, #fb923c); --ht: var(--g-fire, #fb923c); }
.fx-hype.is-s1 .fx-hype-ico { background: var(--ui-accent-soft, rgba(178,107,255,.14)); }
.fx-hype.is-s2 .fx-hype-ico { background: rgba(251, 191, 36, .14); }
.fx-hype.is-s3 .fx-hype-ico { background: rgba(251, 146, 60, .16); }
.fx-hype.flare .fx-hype-bar { animation: fx-flare .45s ease-out 1; }
@keyframes fx-flare { 0% { box-shadow: 0 0 0 0 rgba(251, 146, 60, .55); } 100% { box-shadow: 0 0 0 10px rgba(251, 146, 60, 0); } }
.fx-hype-lg { gap: 10px; }
.fx-hype-lg .fx-hype-bar { height: 16px; }
.fx-hype-lg .fx-hype-ico { width: 36px; height: 36px; }
.fx-hype-lg .fx-hype-ico .ui-icon { font-size: 22px; }
.fx-hype-lg .fx-hype-l { font-size: var(--ui-fs-lg, 16px); }
.fx-hype-lg .fx-hype-s { font-size: var(--ui-fs-xl, 20px); }

/* ---------- (c) Cortinilla / cuenta regresiva ---------- */
.fx-cur { position: fixed; inset: 0; z-index: 9500; overflow: hidden; background: rgba(8, 6, 12, .55); color: var(--ui-text, #ece8f3); }
.fx-cur-panel { position: absolute; inset: 0; display: grid; place-items: center; will-change: transform;
  background:
    radial-gradient(70% 55% at 28% 30%, rgba(178, 107, 255, .16), transparent 70%),
    radial-gradient(60% 50% at 80% 85%, rgba(99, 102, 241, .10), transparent 70%),
    #110e18; }
.fx-cur-edge { position: absolute; top: 0; bottom: 0; right: 0; width: 3px; background: var(--ui-accent, #b26bff); opacity: .85; }
.fx-cur.is-calm .fx-cur-edge { display: none; }
.fx-cur-in { width: min(720px, 100%); padding: 24px; text-align: center; }
.fx-cur-ico { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 16px; background: var(--ui-accent-soft, rgba(178,107,255,.14)); color: var(--ui-accent-text, #d5b3ff); box-shadow: inset 0 0 0 1px rgba(178, 107, 255, .3); }
.fx-cur-ico .ui-icon { font-size: 30px; }
.fx-cur-ico.is-live { background: var(--ui-live-soft, rgba(34,211,238,.12)); color: var(--ui-live, #22d3ee); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .3); }
.fx-cur-k { margin: 0 0 10px; font: 600 var(--ui-fs-md, 14px)/1.3 var(--ui-font, sans-serif); color: var(--ui-accent-text, #d5b3ff); }
.fx-cur-t { margin: 0 auto; max-width: 22ch; font: 700 clamp(24px, 5.2vw, 46px)/1.15 var(--ui-font-display, sans-serif); letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fx-cur-num { margin-top: clamp(20px, 4vh, 36px); height: 1em; font: 700 clamp(104px, 28vw, 200px)/1 var(--ui-font-display, sans-serif); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.fx-cur-num span { display: inline-block; }
.fx-cur-num span.is-go { color: var(--ui-success, #4ade80); font-size: .62em; letter-spacing: -.02em; vertical-align: .3em; }
.fx-cur-prog { width: min(240px, 60vw); height: 4px; margin: clamp(16px, 3vh, 28px) auto 0; border-radius: 999px; background: var(--ui-surface-3, #252033); overflow: hidden; }
.fx-cur-prog i { display: block; height: 100%; background: var(--ui-accent, #b26bff); transform: scaleX(0); transform-origin: 0 50%; transition-property: transform; transition-timing-function: linear; }
.fx-cur.is-calm .fx-cur-prog i { transition: none; }

/* ---------- (d) Revelación: barras de distribución ---------- */
.fx-rv { --ok: var(--ui-success, #4ade80); }
.fx-rv-h { display: grid; gap: 8px; }
.fx-rv-row { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: var(--ui-radius-lg, 14px);
  background: var(--ui-surface-2, #1c1826); border: 1px solid var(--ui-border, rgba(255,255,255,.07));
  transition: opacity .3s var(--ui-ease, ease), border-color .3s, background-color .3s; }
.fx-rv-key { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--c); color: #fff; }
.fx-rv-key .ui-icon { font-size: 20px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.fx-rv-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.fx-rv-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-rv-lbl { flex: 1; min-width: 0; font-weight: 600; font-size: var(--ui-fs-md, 14px); line-height: 1.3; color: var(--ui-text, #ece8f3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fx-rv-tags { display: inline-flex; gap: 4px; flex: none; }
.fx-rv-fig { display: inline-flex; align-items: baseline; gap: 6px; flex: none; font-family: var(--ui-font-mono, monospace); font-variant-numeric: tabular-nums; }
.fx-rv-n { font-size: var(--ui-fs-lg, 16px); font-weight: 600; color: var(--ui-text, #ece8f3); min-width: 2ch; text-align: right; }
.fx-rv-pct { font-size: var(--ui-fs-sm, 13px); color: var(--ui-text-3, #7a7287); min-width: 4ch; text-align: right; }
.fx-rv-track { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--ui-surface-3, #252033); overflow: hidden; }
.fx-rv-track i { position: absolute; inset: 0; background: var(--c); border-radius: inherit; transform-origin: 0 50%; transform: scaleX(0); transition: transform .42s var(--ui-ease, ease); }
.fx-rv.is-grown .fx-rv-track i { transform: scaleX(var(--p)); }
.fx-rv-tag { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px 0 6px; border-radius: 999px; font: 600 var(--ui-fs-xs, 12px)/1 var(--ui-font, sans-serif); white-space: nowrap; }
.fx-rv-tag .ui-icon { font-size: 14px; }
.fx-rv-tag.is-ok { display: none; background: var(--ui-success-soft, rgba(74,222,128,.12)); color: var(--ok); }
.fx-rv-tag.is-me { background: var(--ui-accent-soft, rgba(178,107,255,.14)); color: var(--ui-accent-text, #d5b3ff); }
.fx-rv.is-revealed .fx-rv-tag.is-ok { display: inline-flex; }
.fx-rv.is-revealed .fx-rv-row:not(.is-correct) { opacity: .52; }
.fx-rv.is-revealed .fx-rv-row.is-correct { border-color: rgba(74, 222, 128, .55); background: linear-gradient(rgba(74, 222, 128, .07), rgba(74, 222, 128, .07)), var(--ui-surface-2, #1c1826); }
.fx-rv.is-revealed .fx-rv-row.is-mine:not(.is-correct) { opacity: .8; }
@media (max-width: 480px) { .fx-rv-row { padding: 10px; gap: 10px; } .fx-rv-key { width: 32px; height: 32px; } .fx-rv-top { flex-wrap: wrap; row-gap: 4px; } .fx-rv-lbl { flex: 1 1 0; } .fx-rv-tags { order: 3; flex: 1 1 100%; } .fx-rv-tags:empty { display: none; } .fx-rv-tags .fx-rv-tag { padding: 0 6px; } }
/* Vertical (proyector) */
.fx-rv-v { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; height: var(--fx-rv-h, 340px); }
.fx-rv-v .fx-rv-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
.fx-rv-v .fx-rv-key { order: 2; width: 100%; height: 40px; }
.fx-rv-v .fx-rv-main { order: 1; display: flex; flex-direction: column-reverse; gap: 10px; }
.fx-rv-v .fx-rv-top { flex-direction: column; align-items: stretch; gap: 6px; text-align: center; }
.fx-rv-v .fx-rv-lbl { -webkit-line-clamp: 2; text-align: center; }
.fx-rv-v .fx-rv-fig { justify-content: center; }
.fx-rv-v .fx-rv-n { font-size: 28px; font-family: var(--ui-font-display, sans-serif); font-weight: 700; min-width: 0; text-align: center; }
.fx-rv-v .fx-rv-tags { justify-content: center; min-height: 22px; }
.fx-rv-v .fx-rv-track { flex: 1; height: auto; min-height: 80px; border-radius: 10px; }
.fx-rv-v .fx-rv-track i { transform-origin: 50% 100%; transform: scaleY(0); }
.fx-rv-v.is-grown .fx-rv-track i { transform: scaleY(var(--p)); }

/* ---------- (e) Aviso de racha ---------- */
.fx-st { position: fixed; z-index: 9002; left: 50%; top: calc(var(--fx-toast-top, 72px) + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 8px 10px 8px 8px; border-radius: 999px;
  background: var(--ui-surface-1, #15121d); border: 1px solid rgba(251, 146, 60, .45); box-shadow: var(--ui-shadow-pop, 0 16px 48px rgba(0,0,0,.55));
  color: var(--ui-text, #ece8f3); pointer-events: none; opacity: 0; transform: translate(-50%, -12px) scale(.96);
  transition: opacity .2s var(--ui-ease, ease), transform .3s cubic-bezier(.2, 1.3, .4, 1); }
.fx-st.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.fx-st.is-low { top: calc(var(--fx-toast-top, 72px) + 92px + env(safe-area-inset-top, 0px)); }
.fx-st-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--g-fire, #fb923c); color: #1d0e02; }
.fx-st-ico .ui-icon { font-size: 24px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.fx-st-txt { display: grid; gap: 1px; min-width: 0; padding-right: 2px; }
.fx-st-k { font-size: var(--ui-fs-xs, 12px); font-weight: 600; color: var(--g-fire, #fb923c); line-height: 1.2; }
.fx-st-n { font: 700 var(--ui-fs-md, 14px)/1.2 var(--ui-font-display, sans-serif); white-space: nowrap; }
.fx-st-mult { flex: none; padding: 6px 10px; border-radius: 999px; background: rgba(251, 146, 60, .16); color: var(--g-fire, #fb923c); font: 600 var(--ui-fs-md, 14px)/1 var(--ui-font-mono, monospace); }
.fx-st.is-hot { border-color: rgba(251, 146, 60, .7); }

/* ---------- (f) Skeletons y shimmer ---------- */
.fx-sk { position: relative; display: block; height: 14px; border-radius: 6px; background: var(--ui-surface-2, #1c1826); overflow: hidden; }
.fx-sk::after, .fx-shimmer::after, .fx-sweep::after { content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .07) 50%, transparent 80%); }
.fx-sk::after, .fx-shimmer::after { animation: fx-shim 1.4s ease-in-out infinite; }
.fx-shimmer, .fx-sweep { position: relative; overflow: hidden; }
.fx-sweep::after { background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .14) 50%, transparent 75%); animation: fx-shim .8s var(--ui-ease, ease) 1 forwards; }
@keyframes fx-shim { to { transform: translateX(100%); } }
.fx-sk-wrap { display: grid; gap: 12px; }
.fx-sk-sm { height: 10px; }
.fx-sk-lg { height: 22px; border-radius: 8px; }
.fx-sk-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.fx-sk-col { flex: 1; display: grid; gap: 8px; min-width: 0; }
.fx-sk-av { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.fx-sk-num { flex: none; width: 20px; height: 20px; border-radius: 6px; }
.fx-sk-pts { flex: none; width: 52px; height: 18px; }
.fx-sk-card { display: grid; gap: 10px; padding: 12px; border-radius: var(--ui-radius-lg, 14px); border: 1px solid var(--ui-border, rgba(255,255,255,.07)); }
.fx-sk-media { height: 120px; border-radius: 10px; }
.fx-sk-q { display: grid; gap: 12px; }
.fx-sk-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.fx-sk-opt { height: 64px; border-radius: 12px; }
@media (max-width: 480px) { .fx-sk-opts { grid-template-columns: minmax(0, 1fr); } .fx-sk-opt { height: 52px; } }

/* ---------- Calma / reduced-motion ---------- */
.fx-calm, .fx-calm * { transition-property: opacity, background-color, border-color, color !important; animation: none !important; }
.fx-st.fx-calm { transform: translate(-50%, 0); }
.fx-rx-tally.fx-calm { transform: none; }
body.nf-calma .fx-sk::after, body.nf-calma .fx-shimmer::after, body.nf-calma .fx-sweep::after { animation: none; display: none; }
body.nf-calma .fx-st, body.nf-calma .fx-rx-tally, body.nf-calma .fx-rv-row, body.nf-calma .fx-hype-fill { transition-property: opacity, background-color, border-color; }
body.nf-calma .fx-st { transform: translate(-50%, 0); }
body.nf-calma .fx-hype.flare .fx-hype-bar { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fx-sk::after, .fx-shimmer::after, .fx-sweep::after { animation: none; display: none; }
  .fx-st { transform: translate(-50%, 0); transition: opacity .2s; }
  .fx-rx-tally { transform: none; transition: opacity .2s; }
  .fx-hype-fill, .fx-rv-track i { transition: none; }
  .fx-hype.flare .fx-hype-bar { animation: none; }
}

/* Cortinilla breve (sala): no bloquea toques ni consume el tiempo de respuesta */
.fx-cur.is-brief { pointer-events: none; }
