#graph-energy-mask {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 112px 24px 72px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#graph-energy-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(196, 146, 98, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(7, 10, 18, 0.24) 0%, rgba(7, 10, 18, 0.62) 52%, rgba(7, 10, 18, 0.86) 100%);
}

#p-graph.freemium-energy-depleted #graph-energy-mask {
  opacity: 1;
  pointer-events: auto;
}

#p-graph.freemium-energy-depleted #graph-energy-mask.dismissed {
  opacity: 0;
  pointer-events: none;
}

#graph-energy-mask .gem-panel {
  position: relative;
  width: min(420px, calc(100vw - 48px));
  padding: 24px 22px 20px;
  border-radius: 24px;
  border: 1px solid rgba(216, 184, 116, 0.2);
  background:
    linear-gradient(180deg, rgba(18, 20, 30, 0.84) 0%, rgba(12, 14, 21, 0.92) 100%);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
}

#graph-energy-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(212, 207, 196, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#graph-energy-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 238, 221, 0.88);
}

#graph-energy-close:active {
  transform: scale(0.96);
}

#graph-energy-mask .gem-kicker {
  margin-bottom: 10px;
  color: rgba(240, 187, 102, 0.76);
  font: 500 10px/1 var(--mono, "SF Mono", monospace);
  letter-spacing: 0.22em;
}

#graph-energy-mask .gem-title {
  color: rgba(244, 238, 221, 0.96);
  font: 600 24px/1.2 var(--serif, "Lora", serif);
}

#graph-energy-mask .gem-body {
  margin-top: 12px;
  color: rgba(212, 207, 196, 0.74);
  font-size: 14px;
  line-height: 1.65;
}

#graph-energy-cta {
  margin-top: 18px;
  min-width: 188px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(216, 184, 116, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(216, 184, 116, 0.22), rgba(216, 184, 116, 0.1));
  color: rgba(250, 240, 214, 0.96);
  font: 500 12px/1 var(--mono, "SF Mono", monospace);
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#graph-energy-cta:hover {
  border-color: rgba(216, 184, 116, 0.42);
  background: linear-gradient(135deg, rgba(216, 184, 116, 0.28), rgba(216, 184, 116, 0.14));
}

#graph-energy-cta:active {
  transform: scale(0.98);
}

#p-graph.freemium-energy-depleted #fg-wrap {
  filter: saturate(0.55) brightness(0.52);
  opacity: 0.56;
}

#p-graph.freemium-energy-depleted #g-hint,
#p-graph.freemium-energy-depleted #topbar {
  opacity: 0.48;
}

#p-graph.freemium-energy-depleted #drawer-pill,
#p-graph.freemium-energy-depleted #ghost-back {
  opacity: 0.35;
}

#bs-energy-pill.freemium-pill-danger {
  color: rgba(245, 184, 184, 0.96);
  border-color: rgba(217, 114, 114, 0.32) !important;
  background: rgba(217, 114, 114, 0.12);
}

@media (max-width: 599px) {
  #graph-energy-mask {
    align-items: flex-end;
    padding: 88px 16px calc(max(env(safe-area-inset-bottom), 18px) + 44px);
  }

  #graph-energy-mask .gem-panel {
    width: min(100%, 420px);
    padding: 22px 18px 18px;
    border-radius: 22px;
  }

  #graph-energy-mask .gem-title {
    font-size: 22px;
  }

  #graph-energy-mask .gem-body {
    font-size: 13px;
  }
}
