import 'package:flutter/material.dart';

/// Rangée de statistiques de fin de partie (STREAK / SEEN / SCORE).
class GameOverStats extends StatelessWidget {
  final String streak;
  final String seen;
  final String score;

  const GameOverStats({super.key, required this.streak, required this.seen, required this.score});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Expanded(child: _StatBox(label: "STREAK", value: streak)),
        const SizedBox(width: 16),
        Expanded(child: _StatBox(label: "SEEN", value: seen)),
        const SizedBox(width: 16),
        Expanded(child: _StatBox(label: "SCORE", value: score)),
      ],
    );
  }
}

/// Une case de statistique : un libellé rouge au-dessus d'une valeur.
class _StatBox extends StatelessWidget {
  final String label;
  final String value;

  const _StatBox({required this.label, required this.value});

  @override
  Widget build(BuildContext context) {
    return Container(
      color: const Color(0xFFD9E0E5),
      padding: const EdgeInsets.symmetric(vertical: 12),
      child: Column(
        children: [
          Text(
            label,
            style: const TextStyle(color: Colors.red, fontSize: 10, fontWeight: FontWeight.bold, letterSpacing: 1),
          ),
          const SizedBox(height: 4),
          Text(
            value,
            style: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.bold),
          ),
        ],
      ),
    );
  }
}
