/* v1.4.3 menu safety: hide live-ops/post-run chrome while the title/menu is open. */
.flamin-go-run-root.fgr-menu-is-open .fgr-retention-optimizer-layer,
.flamin-go-run-root:has(.fgr-menu-overlay) .fgr-retention-optimizer-layer,
.flamin-go-run-root:has(.fgr-menu-clean-overlay) .fgr-retention-optimizer-layer,
.fgr-retention-optimizer-layer.is-menu-open {
  display: none !important;
}

/* Flamin' Go Run retention optimizer v1.4.3 */
.fgr-retention-optimizer-layer,
.fgr-retention-optimizer-layer * { box-sizing: border-box; }
.fgr-retention-optimizer-layer {
  position: absolute;
  inset: 0;
  z-index: 64;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
}
.fgr-ro-liveops {
  position: absolute;
  left: clamp(10px, 2.4vw, 24px);
  bottom: clamp(88px, 12vw, 134px);
  width: min(260px, calc(100vw - 24px));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(2,6,23,.66), rgba(67,20,83,.58));
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(13px);
  opacity: .82;
  transform: translateZ(0);
}
.fgr-ro-liveops span {
  display: block;
  color: rgba(255,255,255,.52);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.fgr-ro-liveops strong {
  display: block;
  margin-top: 3px;
  color: #fef08a;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: -.02em;
}
.fgr-ro-liveops small {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.64);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}
.fgr-ro-panel {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3.2vw, 34px);
  width: min(560px, calc(100vw - 24px));
  pointer-events: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(250,204,21,.30);
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(250,204,21,.18), transparent 32%), linear-gradient(135deg, rgba(15,23,42,.94), rgba(48,13,61,.90));
  box-shadow: 0 24px 80px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.10);
  padding: 16px;
  backdrop-filter: blur(16px);
  animation: fgrRoPanelIn .22s ease both;
}
.fgr-ro-panel[hidden] { display: none !important; }
@keyframes fgrRoPanelIn {
  from { opacity: 0; transform: translate3d(-50%, 14px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
}
.fgr-ro-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.fgr-ro-kicker {
  color: rgba(255,255,255,.55);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.fgr-ro-panel > strong {
  display: block;
  max-width: calc(100% - 34px);
  margin-top: 4px;
  color: #fff;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 1000;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.fgr-ro-panel p {
  max-width: 46rem;
  margin: 7px 0 12px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}
.fgr-ro-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.fgr-ro-metrics span {
  display: block;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  padding: 8px 10px;
  color: rgba(255,255,255,.52);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fgr-ro-metrics b {
  display: block;
  margin-bottom: 2px;
  color: #fef08a;
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: -.03em;
  text-transform: none;
}
.fgr-ro-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fgr-ro-actions button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #fb7185);
  color: #111827;
  box-shadow: 0 12px 30px rgba(251,113,133,.22);
  padding: 10px 13px;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}
.fgr-ro-actions button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.fgr-ro-actions button:active { transform: translateY(1px) scale(.99); }
@media (max-width: 720px) {
  .fgr-ro-liveops { display: none; }
  .fgr-ro-panel { bottom: 10px; border-radius: 20px; padding: 13px; }
  .fgr-ro-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .fgr-ro-actions button { flex: 1 1 auto; padding: 10px 9px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .fgr-ro-panel { animation: none; }
  .fgr-ro-actions button { transition: none; }
}


/* v1.4.3 phase gates */
.fgr-retention-optimizer-layer { contain: layout style paint; }
.fgr-retention-optimizer-layer.is-menu-open { display: none !important; }
.fgr-retention-optimizer-layer:not(.is-playing) .fgr-ro-liveops { display: none !important; }
.fgr-retention-optimizer-layer:not(.is-postrun) .fgr-ro-panel[hidden] { display: none !important; }
.flamin-go-run-root.fgr-phase-playing .fgr-ro-liveops { display: block; }
.flamin-go-run-root.fgr-phase-menu .fgr-retention-optimizer-layer,
.flamin-go-run-root.fgr-menu-is-open .fgr-retention-optimizer-layer { display: none !important; }
@media (max-width: 720px) {
  .fgr-ro-panel { max-height: min(60vh, 360px); overflow: auto; -webkit-overflow-scrolling: touch; }
}


/* v1.4.3 active-game cleanup: keep live-ops suggestions off the gameplay viewport. */
.fgr-retention-optimizer-layer.is-playing .fgr-ro-liveops,
.flamin-go-run-root.fgr-phase-playing .fgr-ro-liveops,
.flamin-go-run-root:has(.fgr-hud) .fgr-ro-liveops {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
