// Copyright (c) 2025-2026, RTE (https://www.rte-france.com)
// This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0.
// If a copy of the Mozilla Public License, version 2.0 was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: MPL-2.0
// This file is part of Co-Study4Grid a Power Grid Study tool Assistant Interface to help solve contigencies for a grid state under study.
import App from '../App';
import { colors, space, text, radius } from '../styles/tokens';
import GameConfigScreen from './GameConfigScreen';
import GameHud from './GameHud';
import GameResults from './GameResults';
import { useGameSession } from './useGameSession';
/** Best (lowest) resulting loading among the player's chosen actions. */
function bestRho(rhos: (number | null)[]): number | null {
const valid = rhos.filter((r): r is number => typeof r === 'number');
return valid.length ? Math.min(...valid) : null;
}
/**
* The Game Mode entry point. Mounted by `main.tsx` instead of bare `