# Role

You are a Senior Flutter Developer working on "Colosseum's Choice".
You need to implement a **Stage Recovery System** and a **Global Math Utility**.

# Goals

1.  **Global Math Utility:** Create a central place to handle math logic (specifically "flooring" values) to be used across the game for consistency.
2.  **Stage Recovery:** When a player clears a stage (selects a reward), heal the player for **50% of their Total Max HP** (rounded down).
3.  **Character Logic:** Ensure the `Character` class has a proper `heal` method that respects `maxHp`.

# Required Changes

Please generate the code for the following files.

---

## 1. `lib/utils/game_math.dart` (New File)

**Description:** A static utility class for game calculations.
**Methods:**

- `static int floor(double value)`: Returns the integer part of the value (rounds down). Use this for all percentage-based calculations in the game.

## 2. `lib/models/character.dart` (Update)

**Description:** Add healing capability.
**Methods:**

- `void heal(int amount)`:
  - Add `amount` to `hp`.
  - Clamp `hp` so it does not exceed `totalMaxHp`.
  - **Important:** Only allow healing if `hp > 0` (Dead characters cannot be healed).

## 3. `lib/providers/battle_provider.dart` (Update)

**Description:** Implement the healing logic upon stage completion.
**Methods:**

- `selectReward(Item item)`:
  - (Existing logic: Add item to inventory, increase stage...).
  - **New Logic:**
    1.  Calculate heal amount: `GameMath.floor(player.totalMaxHp * 0.5)`.
    2.  Call `player.heal(healAmount)`.
    3.  Add a log message: "Stage Cleared! Recovered $healAmount HP.".

---

# Output Format

Please provide the complete code for `lib/utils/game_math.dart` and the updated `character.dart`, `battle_provider.dart`.
