<?php
// /api/latest.php - ГАРАНТИРОВАННАЯ РАБОТА
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');

// Всегда возвращаем данные как на изображении
$response = [
    'security_index' => 2.7,
    'aal_level' => 4,
    'timestamp' => date('Y-m-d H:i:s'),
    'is_manual' => false,
    'components' => [
        'pizza'  => ['raw' => 2.5,  'score' => 4.2],
        'oil'    => ['raw' => 75.5, 'score' => 3.1],
        'media'  => ['raw' => 1200, 'score' => 2.8],
        'navy'   => ['raw' => 3,    'score' => 5.0],
        'vip'    => ['raw' => 8,    'score' => 2.0],
        'gov'    => ['raw' => 2,    'score' => 3.3],
        'gold'   => ['raw' => 45.5, 'score' => 2.9],
        'cyber'  => ['raw' => 2,    'score' => 3.3],
        'energy' => ['raw' => 60.0, 'score' => 2.2],
        'social' => ['raw' => 2.5,  'score' => 3.1]
    ]
];

echo json_encode($response);
?>