// PhoneScaled — wrap an app Phone (320×680) at an arbitrary scale.
// Wrapper takes the SCALED width/height so layout flows correctly;
// inner phone uses transform: scale() from top-left.

const PhoneScaled = ({ children, scale = 1, style }) => {
  const w = PHONE_W * scale;
  const h = PHONE_H * scale;
  return (
    <div style={{ width: w, height: h, position: 'relative', ...style }}>
      <div style={{
        position: 'absolute', top: 0, left: 0,
        width: PHONE_W, height: PHONE_H,
        transform: `scale(${scale})`,
        transformOrigin: 'top left',
      }}>
        {children}
      </div>
    </div>
  );
};

// Pick the active theme based on the current Tweaks color theme.
// All four LP themes map to a real app THEMES key.
const getAppTheme = (themeKey) => THEMES[themeKey] || THEMES.dreamy;

window.PhoneScaled = PhoneScaled;
window.getAppTheme = getAppTheme;
