import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import '../tema/componentes_farolero.dart'; import '../tema/tema_app.dart'; import 'pantalla_crear_partida.dart'; class PantallaSeleccionModoJuego extends StatelessWidget { const PantallaSeleccionModoJuego({super.key}); @override Widget build(BuildContext context) { return Scaffold( extendBodyBehindAppBar: true, appBar: AppBar(title: const Text('Elegir modo')), body: FondoFarolero( intenso: true, child: SafeArea( child: Center( child: SingleChildScrollView( padding: const EdgeInsets.fromLTRB(20, 24, 20, 28), child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 470), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: 12), const _ModoHero().animate().fadeIn(duration: 320.ms).slideY(begin: -0.12), const SizedBox(height: 34), _ModoCard( marcoAsset: 'assets/ui/generated/mode/mode_single_card_frame.png', icono: Icons.phone_android_rounded, titulo: 'Un móvil', subtitulo: 'Partida en este dispositivo', descripcion: 'Ideal para jugar todos juntos pasando el móvil. Configuración rápida y directa.', onTap: () => Navigator.push( context, MaterialPageRoute( builder: (_) => const PantallaCrearPartida( modoInicial: false, bloquearModo: true, ), ), ), ).animate().fadeIn(delay: 120.ms).slideX(begin: -0.08), const SizedBox(height: 16), _ModoCard( marcoAsset: 'assets/ui/generated/mode/mode_multi_card_frame.png', icono: Icons.devices_rounded, titulo: 'Multidispositivo', subtitulo: 'Cada jugador en su móvil', descripcion: 'Crea una sala premium, comparte QR y gestiona usuarios desde el lobby.', destacado: true, onTap: () => Navigator.push( context, MaterialPageRoute( builder: (_) => const PantallaCrearPartida( modoInicial: true, bloquearModo: true, ), ), ), ).animate().fadeIn(delay: 200.ms).slideX(begin: 0.08), ], ), ), ), ), ), ), ); } } class _ModoHero extends StatelessWidget { const _ModoHero(); @override Widget build(BuildContext context) { return Column( children: [ SizedBox( height: 230, child: Image.asset( 'assets/ui/generated/mode/mode_duel_hero.png', fit: BoxFit.contain, opacity: const AlwaysStoppedAnimation(0.95), ), ), const SizedBox(height: 10), Text( '?C?mo quer?s jugar?', textAlign: TextAlign.center, style: Theme.of(context).textTheme.headlineMedium?.copyWith( color: TemaApp.colorDorado, fontSize: 32, fontWeight: FontWeight.w900, shadows: [ Shadow(color: TemaApp.colorNaranja.withValues(alpha: 0.45), blurRadius: 16), ], ), ), const SizedBox(height: 8), Text( 'Eleg? el tipo de partida y arranc? sin fricci?n.', textAlign: TextAlign.center, style: Theme.of(context).textTheme.titleMedium?.copyWith( color: TemaApp.colorTextoSecundario, ), ), ], ); } } class _ModoCard extends StatelessWidget { final String marcoAsset; final IconData icono; final String titulo; final String subtitulo; final String descripcion; final bool destacado; final VoidCallback onTap; const _ModoCard({ required this.marcoAsset, required this.icono, required this.titulo, required this.subtitulo, required this.descripcion, required this.onTap, this.destacado = false, }); @override Widget build(BuildContext context) { final color = destacado ? TemaApp.colorNaranja : TemaApp.colorAcento; return Material( color: Colors.transparent, child: InkWell( borderRadius: BorderRadius.circular(28), onTap: onTap, child: Ink( decoration: BoxDecoration( gradient: LinearGradient( colors: [ const Color(0xFF111C29).withValues(alpha: 0.94), (destacado ? const Color(0xFF2A1620) : const Color(0xFF15111F)).withValues(alpha: 0.92), ], begin: Alignment.topLeft, end: Alignment.bottomRight, ), borderRadius: BorderRadius.circular(28), border: Border.all(color: color.withValues(alpha: destacado ? 0.78 : 0.48)), boxShadow: [ BoxShadow( color: color.withValues(alpha: destacado ? 0.26 : 0.14), blurRadius: destacado ? 34 : 22, offset: const Offset(0, 14), ), ], ), child: Stack( children: [ Positioned.fill( child: ClipRRect( borderRadius: BorderRadius.circular(28), child: Image.asset( marcoAsset, fit: BoxFit.fill, opacity: const AlwaysStoppedAnimation(0.86), ), ), ), Positioned.fill( child: Image.asset( 'assets/ui/premium/card_sheen_overlay.png', fit: BoxFit.cover, opacity: AlwaysStoppedAnimation(destacado ? 0.34 : 0.22), ), ), Padding( padding: const EdgeInsets.all(20), child: Row( children: [ Container( width: 64, height: 64, decoration: BoxDecoration( color: color.withValues(alpha: 0.18), borderRadius: BorderRadius.circular(22), border: Border.all(color: color.withValues(alpha: 0.72)), ), child: Icon(icono, color: color, size: 34), ), const SizedBox(width: 16), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( titulo.toUpperCase(), style: Theme.of(context).textTheme.titleLarge?.copyWith( color: destacado ? TemaApp.colorDorado : Colors.white, fontWeight: FontWeight.w900, letterSpacing: 0.8, ), ), const SizedBox(height: 3), Text( subtitulo, style: Theme.of(context).textTheme.titleMedium?.copyWith(color: color), ), const SizedBox(height: 7), Text(descripcion, style: Theme.of(context).textTheme.bodyMedium), ], ), ), const SizedBox(width: 8), Icon(Icons.chevron_right_rounded, color: color, size: 32), ], ), ), ], ), ), ), ); } }