===========================================================
🌀 GRAVITY FLIP DATA PACK (v1.2 - By Raiji)
===========================================================
A self-healing system for randomizing 
player gravity on a persistent, configurable timer.

--- 📂 INSTALLATION ---
1. Place the 'gravity' folder into your world's 'datapacks' folder.
2. Join the world and run: /reload
3. The system auto-initializes to 5 minutes (6000 ticks).

--- 🛡️ ADMIN SETUP & SECURITY ---
To grant permissions, an OP must run: /tag <player> add admin

PERMISSIONS:
- Only players with the 'admin' tag can use control triggers.
- Admins can toggle 'Immunity' to stay upright during flips.
- SECURITY SYNC: If a player's 'admin' tag is removed, their 
  'immunity' is instantly revoked by the system.

--- 🛠️ ADMIN CONTROL PANEL ---
Triggers only work for players with the 'admin' tag.

| Command                         | Action                                  |
|---------------------------------|-----------------------------------------|
| /trigger display set 1          | SHOW the countdown on the sidebar.      |
| /trigger display set -1         | HIDE the countdown sidebar.             |
| /trigger gravity_timer set <X>  | Set new flip interval (in ticks).       |
| /trigger gravity_start          | RESUME the clock if stopped.            |
| /trigger gravity_stop           | PAUSE the clock and all flips.          |
| /trigger gravity_immune         | TOGGLE your own flip immunity.          |

--- ⚙️ CONFIGURATION & TIME ---
- 20 ticks = 1 second.
- 5 Minutes: 6000 ticks | 10 Minutes: 12000 ticks.
- Setting a new timer updates the config permanently and 
  restarts the current clock to that value immediately.

--- 🛠️ TROUBLESHOOTING & REPAIR ---
- Engine Failure/Freeze: Run /reload.
- Infinite Flips: This happens if scores are wiped. Run /reload 
  to trigger the Safety Valve and restore defaults.
- Clean Sidebar: To remove "ghost" names from the sidebar, run:
  /scoreboard players reset * countdown

--- 📝 TECHNICAL SPECS ---
- Heartbeat: 1t (20Hz) via 'schedule'.
- Safety Valve: Logic halts if core config scores are missing.
- Warnings: Gold alert at 30s, Red alert at 10s.
===========================================================