import { ConvertToBase64WhenRelease } from "@24tools/ads_common";

// Heavy display font used for the HUD labels (matches the REF look). Inlined as
// base64 on release. We inject an @font-face at runtime so it works in dev too.
const passionOneUrl = ConvertToBase64WhenRelease("./PassionOne-Black.otf");

export const PASSION_ONE = "PassionOne";

let injected = false;

/** Register the PassionOne font once. Safe to call multiple times. */
export function ensurePassionOne() {
  if (injected) return;
  injected = true;
  const style = document.createElement("style");
  style.textContent =
    `@font-face{font-family:'${PASSION_ONE}';` +
    `src:url(${passionOneUrl}) format('opentype');font-weight:900;font-display:swap;}`;
  document.head.appendChild(style);
}
