#ifndef JNR_ANALYTICS_H
#define JNR_ANALYTICS_H

#include "game/stats.h"

/* Initialize analytics subsystem (load/generate client_id).
 * No-op on non-WASM builds. */
void analytics_init(void);

/* Start a new analytics session. Sends POST to the backend. */
void analytics_session_start(void);

/* End the current analytics session with final stats.
 * Computes the composite score before sending.
 * end_reason: "death", "quit", "timeout", or "completed". */
void analytics_session_end(GameStats *stats, const char *end_reason);

#endif /* JNR_ANALYTICS_H */
