// trail.hpp - Configuració de l'estela de partícules de la nau
// © 2026 JailDesigner

#pragma once

namespace Defaults::Trail {

    constexpr int POOL_SIZE = 200;

    constexpr float SPEED_THRESHOLD_PX_S = 54.0F;  // 30% de player.yaml::physics.max_velocity (180 px/s)
    constexpr float EMIT_INTERVAL_S = 0.04F;       // ~25 Hz nominal
    constexpr float EMIT_JITTER_S = 0.015F;        // ±15 ms al cooldown
    constexpr float POSITION_JITTER_PX = 2.5F;     // jitter al punt de naixement
    constexpr float REAR_OFFSET_PX = 12.0F;        // distància darrere center_ (cua)

    constexpr float LIFETIME_BASE_S = 1.3F;
    constexpr float LIFETIME_JITTER_S = 0.3F;

    constexpr float SCALE_MIN = 0.7F;  // × estrella starfield (3 px punta)
    constexpr float SCALE_MAX = 1.2F;

    constexpr float OSCILLATION_AMP_PX = 1.8F;
    constexpr float OSCILLATION_FREQ_HZ = 6.0F;

    constexpr float PULSE_FREQ_HZ = 2.5F;

    // Colors del pulse (interpolats sinusoïdalment per partícula)
    // P1: groc viu ↔ daurat clàssic
    constexpr unsigned char COLOR_A_R = 255;
    constexpr unsigned char COLOR_A_G = 255;
    constexpr unsigned char COLOR_A_B = 0;  // #FFFF00
    constexpr unsigned char COLOR_B_R = 218;
    constexpr unsigned char COLOR_B_G = 165;
    constexpr unsigned char COLOR_B_B = 32;  // #DAA520

    // P2: roig viu ↔ rosa
    constexpr unsigned char COLOR_P2_A_R = 255;
    constexpr unsigned char COLOR_P2_A_G = 31;
    constexpr unsigned char COLOR_P2_A_B = 31;  // #FF1F1F
    constexpr unsigned char COLOR_P2_B_R = 255;
    constexpr unsigned char COLOR_P2_B_G = 105;
    constexpr unsigned char COLOR_P2_B_B = 180;  // #FF69B4

}  // namespace Defaults::Trail
