@extends('layouts.admin') @section('title','Games') @section('admin-content')
CHOOSE YOUR LUCKY MOMENT

Games.

Choose a game. Open Settings to customise, preview or activate it.

Active game: {{ ['lucky-wheel'=>'Lucky Wheel','lucky-gift-box'=>'Lucky Gift Box','lucky-scratch-card'=>'Lucky Scratch Card','lucky-capsule-machine'=>'Lucky Capsule Machine'][$activeGame] }}. Games share receipt plays, prize stock and reward history. Changing games keeps remaining plays.

@foreach(['lucky-wheel'=>['Lucky Wheel','Turn the wheel for a little surprise.','wheel'],'lucky-gift-box'=>['Lucky Gift Box','Choose a gift and discover your lucky moment.','gift'],'lucky-scratch-card'=>['Lucky Scratch Card','Scratch away the coating to discover your reward.','scratch'],'lucky-capsule-machine'=>['Lucky Capsule Machine','Turn the handle and open a lucky capsule.','capsule']] as $key=>[$name,$description,$art])

{{ $name }}

{{ $description }}

@if(app(\App\Services\TeamAccess::class)->can(auth()->user(),'games.activate'))
@csrf @if($key!=='lucky-wheel')@foreach((match($key){'lucky-gift-box'=>$gift,'lucky-scratch-card'=>$scratch,default=>$capsule}) as $field=>$value)@endforeach @endif
@endif
@endforeach
@foreach(['lucky-wheel'=>'Lucky Wheel','lucky-gift-box'=>'Lucky Gift Box','lucky-scratch-card'=>'Lucky Scratch Card','lucky-capsule-machine'=>'Lucky Capsule Machine'] as $key=>$name) has('errors')&&old('game')===$key) data-auto-open @endif>

{{ $name }} settings

@csrf
@if(session()->has('errors')&&old('game')===$key)@endif @if($key==='lucky-wheel')

Your existing wheel layout, prize images and appearance settings are kept.

Preview or activate this game below. Layout and appearance open their existing settings pages.

@elseif($key==='lucky-capsule-machine')
@foreach(['machine_color'=>'Machine colour','capsule_color'=>'Capsule colour'] as $field=>$label)@endforeach

Starting the machine uses one receipt play and saves the weighted reward before the capsule drops. Skip animation is available. Preview creates sample results only.

@elseif($key==='lucky-scratch-card')

Starting a card uses one receipt play and saves the weighted reward before scratching. Reveal without scratching is available for accessibility. Preview creates sample results only.

@else

The actual reward uses the prize weights and assigned prize pool. High-value PIN displays in the other boxes are a separate showcase.

Preview uses sample rewards only. Reduced-motion preferences skip effects. Sound stays optional. Saving settings does not activate the game. @endif
@endforeach @endsection @push('scripts')@endpush