@if(isset($customGames))
@foreach($customGames as $customGame)
@php
// Use stored styling from database
$gameIcon = $customGame->icon;
$gameGradient = $customGame->color_gradient;
// Extract color names from gradient for consistent theming
$gradientParts = explode(' ', $gameGradient);
$primaryColor = str_replace(['from-', '-500'], '', $gradientParts[0] ?? 'purple');
// Map to predefined color classes
$colorMap = [
'red' => ['from-red-500/20 to-pink-500/20', 'border-red-500/30', 'hover:border-red-500/50', $gameGradient, 'text-red-300'],
'pink' => ['from-pink-500/20 to-rose-500/20', 'border-pink-500/30', 'hover:border-pink-500/50', $gameGradient, 'text-pink-300'],
'rose' => ['from-rose-500/20 to-pink-500/20', 'border-rose-500/30', 'hover:border-rose-500/50', $gameGradient, 'text-rose-300'],
'purple' => ['from-purple-500/20 to-blue-500/20', 'border-purple-500/30', 'hover:border-purple-500/50', $gameGradient, 'text-purple-300'],
'blue' => ['from-blue-500/20 to-indigo-500/20', 'border-blue-500/30', 'hover:border-blue-500/50', $gameGradient, 'text-blue-300'],
'green' => ['from-green-500/20 to-teal-500/20', 'border-green-500/30', 'hover:border-green-500/50', $gameGradient, 'text-green-300'],
'orange' => ['from-orange-500/20 to-red-500/20', 'border-orange-500/30', 'hover:border-orange-500/50', $gameGradient, 'text-orange-300'],
'yellow' => ['from-yellow-500/20 to-orange-500/20', 'border-yellow-500/30', 'hover:border-yellow-500/50', $gameGradient, 'text-yellow-300'],
'teal' => ['from-teal-500/20 to-cyan-500/20', 'border-teal-500/30', 'hover:border-teal-500/50', $gameGradient, 'text-teal-300'],
'cyan' => ['from-cyan-500/20 to-blue-500/20', 'border-cyan-500/30', 'hover:border-cyan-500/50', $gameGradient, 'text-cyan-300'],
'indigo' => ['from-indigo-500/20 to-purple-500/20', 'border-indigo-500/30', 'hover:border-indigo-500/50', $gameGradient, 'text-indigo-300'],
'violet' => ['from-violet-500/20 to-purple-500/20', 'border-violet-500/30', 'hover:border-violet-500/50', $gameGradient, 'text-violet-300'],
'emerald' => ['from-emerald-500/20 to-green-500/20', 'border-emerald-500/30', 'hover:border-emerald-500/50', $gameGradient, 'text-emerald-300']
];
$gameColor = $colorMap[$primaryColor] ?? $colorMap['purple'];
@endphp
@endforeach
@endif