/* ======================================================
   ARROWS ESCAPE — ADMIN CONFIG
   Change settings here without editing game logic.
   ====================================================== */

const GAME_CONFIG = {
  // ---------------- LIVES ----------------
  defaultLives: 5,
  maxLives: 5,

  // ---------------- COINS ----------------
  startingCoins: 0,
  normalLevelReward: 10,
  hardLevelReward: 20,       // Hard / Expert / Master tiers
  hintCost: 20,

  // ---------------- ADS ----------------
  adsEnabled: false,            // master switch
  showTopBanner: true,
  showBottomBanner: true,
  interstitialEveryNLevels: 3,
  rewardedAdGrantsLives: 5,

  // ---------------- DIFFICULTY TIERS ----------------
  difficultyTiers: {
    Easy:   { range: [1, 20],  reward: 10 },
    Medium: { range: [21, 40], reward: 10 },
    Hard:   { range: [41, 60], reward: 20 },
    Expert: { range: [61, 80], reward: 20 },
    Master: { range: [81, 100], reward: 20 },
  },

  // ---------------- THEME / COLORS ----------------
  theme: {
    primaryBlue: "#2563eb",
    primaryBlueDark: "#1d4ed8",
    primaryBlueLight: "#dbeafe",
    black: "#111827",
    red: "#ef4444",
    green: "#22c55e",
    gold: "#f59e0b",
  },

  // ---------------- AUDIO ----------------
  audioEnabled: true,
  useSynthesizedTones: true, // true = Web Audio generated tones (no files needed)
  audioFiles: {              // used only if useSynthesizedTones is false
    click: "assets/sounds/click.mp3",
    success: "assets/sounds/success.mp3",
    fail: "assets/sounds/fail.mp3",
    coin: "assets/sounds/coin.mp3",
  },

  // ---------------- GAMEPLAY ----------------
  vibrateOnWrongMs: 200,
  wrongMoveFlashMs: 400,
  totalLevels: 100,
};

// Helper: get difficulty tier name + coin reward for a level number
function getLevelRewardConfig(levelNum) {
  for (const [name, cfg] of Object.entries(GAME_CONFIG.difficultyTiers)) {
    if (levelNum >= cfg.range[0] && levelNum <= cfg.range[1]) {
      return { difficulty: name, reward: cfg.reward };
    }
  }
  return { difficulty: "Easy", reward: GAME_CONFIG.normalLevelReward };
}
