/* v1.4.3 menu safety: hide floating objective widgets while the title/menu is open. */
.flamin-go-run-root.fgr-menu-is-open .fgr-engagement-layer,
.flamin-go-run-root:has(.fgr-menu-overlay) .fgr-engagement-layer,
.flamin-go-run-root:has(.fgr-menu-clean-overlay) .fgr-engagement-layer,
.fgr-engagement-layer.is-menu-open {
  display: none !important;
}

/* Flamin' Go Run engagement accelerator v1.4.3 */
.fgr-engagement-layer,
.fgr-engagement-layer * { box-sizing: border-box; }
.fgr-engagement-layer {
  position: absolute;
  inset: 0;
  z-index: 46;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
}
.fgr-flow-panel {
  position: absolute;
  left: clamp(10px, 2.4vw, 24px);
  top: clamp(70px, 9vw, 112px);
  width: min(330px, calc(100vw - 24px));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(6,12,31,.74), rgba(88,21,67,.54));
  box-shadow: 0 18px 54px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 13px 14px 12px;
  backdrop-filter: blur(14px);
  opacity: .92;
  transform: translateZ(0);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}
.fgr-engagement-layer.is-idle .fgr-flow-panel { opacity: .72; transform: scale(.985); }
.fgr-engagement-layer.is-hot .fgr-flow-panel {
  border-color: rgba(250,204,21,.42);
  box-shadow: 0 18px 64px rgba(236,72,153,.22), inset 0 1px 0 rgba(255,255,255,.12);
}
.fgr-flow-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fgr-flow-head span,
.fgr-flow-stat span,
.fgr-chest-chip span {
  color: rgba(255,255,255,.52);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.fgr-flow-head strong {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -.03em;
  text-shadow: 0 2px 18px rgba(244,114,182,.28);
}
.fgr-flow-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.fgr-flow-stat {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  padding: 8px;
  min-width: 0;
}
.fgr-flow-stat strong {
  display: block;
  margin-top: 2px;
  color: #fef08a;
  font-size: 16px;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.fgr-flow-bar {
  width: 100%;
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.fgr-flow-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f472b6, #facc15, #7df9ff);
  transition: width .22s ease;
}
.fgr-chest-chip {
  position: absolute;
  right: clamp(10px, 2.4vw, 24px);
  top: clamp(72px, 9vw, 112px);
  width: min(210px, calc(100vw - 24px));
  min-height: 44px;
  overflow: hidden;
  border: 1px solid rgba(250,204,21,.24);
  border-radius: 999px;
  background: rgba(8,13,30,.70);
  box-shadow: 0 18px 48px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 9px 14px;
  backdrop-filter: blur(14px);
}
.fgr-chest-chip strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 2px;
  color: #fef08a;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.fgr-chest-chip i {
  position: absolute;
  inset: auto auto 0 0;
  width: 0%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #facc15, #fb7185, #a78bfa);
  transition: width .24s ease;
}
.fgr-toast-stack {
  position: absolute;
  right: clamp(10px, 2.4vw, 24px);
  bottom: clamp(86px, 12vw, 132px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
}
.fgr-engagement-toast {
  max-width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15,23,42,.88), rgba(40,12,45,.80));
  box-shadow: 0 18px 54px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 11px 13px;
  opacity: 0;
  transform: translate3d(18px, 0, 0) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(12px);
}
.fgr-engagement-toast.is-visible { opacity: 1; transform: translate3d(0,0,0) scale(1); }
.fgr-engagement-toast strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: -.02em;
}
.fgr-engagement-toast span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.66);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.28;
}
.fgr-engagement-toast.is-major { border-color: rgba(250,204,21,.36); background: linear-gradient(135deg, rgba(75,22,76,.90), rgba(120,56,16,.82)); }
.fgr-engagement-toast.is-combo { border-color: rgba(125,249,255,.34); }
.fgr-engagement-toast.is-pickup { border-color: rgba(244,114,182,.34); }
.fgr-engagement-toast.is-warning { border-color: rgba(251,113,133,.38); }
@media (max-width: 720px) {
  .fgr-flow-panel { top: 68px; left: 8px; width: calc(100vw - 16px); max-width: 300px; padding: 10px; border-radius: 18px; }
  .fgr-flow-head strong { font-size: 13px; }
  .fgr-flow-stat { padding: 7px; }
  .fgr-flow-stat strong { font-size: 14px; }
  .fgr-chest-chip { top: auto; bottom: 8px; right: 8px; width: 176px; padding: 7px 12px; }
  .fgr-toast-stack { right: 8px; bottom: 64px; width: min(300px, calc(100vw - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  .fgr-flow-panel,
  .fgr-flow-bar i,
  .fgr-chest-chip i,
  .fgr-engagement-toast { transition: none; }
}


/* v1.4.3 phase gates */
.fgr-engagement-layer { contain: layout style paint; }
.fgr-engagement-layer.is-menu-open,
.fgr-engagement-layer:not(.is-playing):not(.is-postrun) { display: none !important; }
.fgr-engagement-layer:not(.is-playing) .fgr-flow-panel,
.fgr-engagement-layer:not(.is-playing) .fgr-chest-chip { display: none !important; }
.flamin-go-run-root.fgr-phase-menu .fgr-engagement-layer,
.flamin-go-run-root.fgr-menu-is-open .fgr-engagement-layer { display: none !important; }


/* v1.4.3 active-game cleanup: no persistent objective cards over the playfield.
   Run events still feed analytics and short toasts, but the camera/controls stay clear. */
.fgr-engagement-layer.is-playing .fgr-flow-panel,
.fgr-engagement-layer.is-playing .fgr-chest-chip,
.flamin-go-run-root.fgr-phase-playing .fgr-flow-panel,
.flamin-go-run-root.fgr-phase-playing .fgr-chest-chip,
.flamin-go-run-root:has(.fgr-hud) .fgr-flow-panel,
.flamin-go-run-root:has(.fgr-hud) .fgr-chest-chip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
