[key] || 0;
      }

      function saveHighScoreIfAny() {
        const key = getModeKey();
        const store = getHighStore();
        const prev = store[key] || 0;
        if (state.correct > prev) {
          store[key] = state.correct;
          setHighStore(store);
          toast(`New high score for this mode: ${state.correct}!`);
        }
      }

      function toast(msg) {
        const t = document.createElement('div');
        t.textContent = msg;
        t.style.position = 'fixed';
        t