/* Splash → window. */
(function () {
  const { MotoLogo, Spinner, useTheme } = window;

  function Splash() {
    const { dark } = (typeof useTheme === "function" ? useTheme() : null) || { dark: false };
    const bg = dark ? "#0F0F10" : "#FFFFFF";
    const colorTexto = dark ? "#F0F0F0" : "#3C3C3C";
    return (
      <div
        className="flex flex-col items-center justify-center h-screen fade-in"
        style={{ background: bg }}
      >
        <MotoLogo size={100} />
        <h1 className="mt-4 text-2xl font-black" style={{ color: colorTexto }}>CultoRD</h1>
        <div className="mt-6"><Spinner size={28} /></div>
      </div>
    );
  }

  window.Splash = Splash;
})();
