{{-- Header --}}
@if ($state['show_logo_url'] ?? null) @else N @endif

{{ $state['show_title'] ?? $episode->show?->title }}

{{ __('Episode') }} {{ $state['episode_number'] ?? $episode->episode_number }} @if($state['round_label'] ?? null) · {{ $state['round_label'] }} @endif

@if (($state['status'] ?? '') === 'live') {{ __('LIVE') }} @else {{ ucfirst($state['status'] ?? 'offline') }} @endif @if (($state['timer']['state'] ?? 'idle') !== 'idle') {{ $state['timer']['remaining'] ?? 0 }}s @endif
{{-- Somali AI narration --}}
{{ __('Speaking…') }} {{ __('Tap to hear the questions in Somali.') }}
@if (($state['results_published'] ?? false) && in_array($state['status'] ?? '', ['completed']))

{{ __('Final Results') }}

@endif
{{-- Contestant --}}

{{ __('Now Playing') }}

@if ($state['current_contestant'] ?? null) @if ($state['current_contestant']['photo_url'] ?? null) @else
{{ \Illuminate\Support\Str::substr($state['current_contestant']['full_name'], 0, 1) }}
@endif

{{ $state['current_contestant']['full_name'] }}

{{ __('Contestant') }} #{{ $state['current_contestant']['contestant_number'] }}

{{ number_format($state['current_contestant']['points'] ?? 0) }}

{{ __('Points') }}

@else

{{ __('Waiting for a contestant to be selected...') }}

@endif
{{-- Question --}}
@if ($state['question'] ?? null)
{{ $state['question']['points'] }} {{ __('pts') }} {{ ucfirst(str_replace('_', ' ', $state['question']['question_type'])) }}

{{ $state['question']['question_text'] }}

@if ($state['question']['media_url'] ?? null)
@if (in_array($state['question']['media_type'], ['image'])) @elseif (in_array($state['question']['media_type'], ['audio'])) @elseif (in_array($state['question']['media_type'], ['video'])) @endif
@endif @php $questionType = $state['question']['question_type'] ?? null; $options = $state['question']['options'] ?? []; $isRevealed = $state['is_question_revealed'] ?? false; $revealOptionId = $state['reveal']['correct_option_id'] ?? null; $isInteractive = ($state['online_participation']['enabled'] ?? false) && ($state['online_participation']['mode'] ?? '') === 'interactive'; $window = $state['answer_window'] ?? []; $windowOpen = $window['participants_open'] ?? $isInteractive; $counts = $state['submission_counts'] ?? []; $canAnswer = $isInteractive && $windowOpen && ! $isRevealed && auth()->check(); @endphp @if ($counts)
{{ __('Contestants answered') }}: {{ $counts['contestants'] ?? 0 }} {{ __('Participants answered') }}: {{ $counts['participants'] ?? 0 }} {{ __('Pending') }}: {{ $counts['pending'] ?? 0 }} {{ __('Checked') }}: {{ $counts['checked'] ?? 0 }}
@endif @if (in_array($questionType, ['multiple_choice', 'true_false']) && count($options))
@foreach ($options as $option) @php $optionId = $option['id']; $isChosen = $answered && $answeredOptionId === $optionId; $isCorrectOption = $isRevealed && $revealOptionId === $optionId; $showCorrect = $isChosen ? $answerCorrect === true : $isCorrectOption; $showWrong = $isChosen && $answerCorrect === false; $answerState = $showCorrect ? 'correct' : ($showWrong ? 'wrong' : 'idle'); $isLive = $canAnswer && ! $answered; @endphp @endforeach
@endif @if (($state['is_question_revealed'] ?? false) && ($state['reveal']['correct_answer'] ?? null))

{{ __('Correct Answer') }}

{{ $state['reveal']['correct_answer'] }}

@if ($state['reveal']['explanation'] ?? null)

{{ $state['reveal']['explanation'] }}

@endif
@endif {{-- Checked answer result (synced with the control room) --}} @php $answerResult = $state['answer_result'] ?? null; @endphp @if ($answerResult) @php $resultVerdict = $answerResult['result'] ?? null; $resultBorder = match ($resultVerdict) { 'correct' => 'border-emerald-500/50 bg-emerald-500/10', 'incorrect' => 'border-red-500/50 bg-red-500/10', default => 'border-gold-500/30 bg-gold-500/5', }; @endphp

{{ __('Answer Result') }}

{{ $resultVerdict ? __(ucfirst($resultVerdict)) : __('Pending') }}
{{ __('Question') }}
{{ $answerResult['question_text'] }}
{{ __('Contestant') }}
{{ $answerResult['contestant_name'] ?? '-' }}
{{ __('Contestant Answer') }}
{{ $answerResult['answer'] ?? '-' }}
@if (($answerResult['correct_answer'] ?? null))
{{ __('Correct answer') }}
{{ $answerResult['correct_answer'] }}
@endif
{{ __('Points Earned') }}
{{ $resultVerdict ? '+' . (int) ($answerResult['points_awarded'] ?? 0) : '—' }}
{{ __('Total Score') }}
{{ $answerResult['total_score'] !== null ? number_format($answerResult['total_score']) . ' ' . __('pts') : '—' }}
@endif {{-- Online participation --}} @if ($isInteractive)

{{ __('Your answer') }}

@if ($state['question_number'] ?? null) {{ __('Question') }} {{ $state['question_number'] }} @endif @if (($state['timer']['state'] ?? 'idle') !== 'idle') {{ $state['timer']['seconds_remaining'] ?? $state['timer']['remaining'] ?? 0 }}s @endif
@if (! $windowOpen && ! $isRevealed && ! $answered)

{{ __('Answer submissions are currently closed for this question.') }}

@endif @guest

{{ __('Sign in to participate.') }} {{ __('Sign in') }}

@else @if (in_array($questionType, ['multiple_choice', 'true_false'])) @if ($answered)

{{ $answerCorrect === false ? __('JAWAABTA WAA QALAD!') : __('JAWAABTA WAA SAX!') }}

@if ($answerCorrect === false) @if ($state['reveal']['correct_answer'] ?? null)

{{ __('The correct answer is: :answer', ['answer' => $state['reveal']['correct_answer']]) }}

@else

{{ __('Answer locked in') }}

@endif @endif
@else

{{ __('Select one answer') }}

@endif @else
@if ($answered)

{{ $answerCorrect === false ? __('JAWAABTA WAA QALAD!') : __('JAWAABTA WAA SAX!') }}

@endif @endif @endguest @if ($submissionMessage)

{{ $submissionMessage }}

@endif
@endif @else
{{ __('Waiting for the next question...') }}
@endif
{{-- Leaderboard --}}

{{ __('Leaderboard') }}

@forelse ($state['leaderboard'] ?? [] as $row) @empty @endforelse
#{{ __('Contestant') }}{{ __('Points') }}{{ __('Status') }}
{{ $row['rank'] }} {{ $row['name'] }} {{ number_format($row['points']) }} {{ ucfirst($row['status']) }}
{{ __('No contestants yet.') }}
{{-- Announcements --}} @if (count($state['announcements'] ?? []))
@foreach ($state['announcements'] as $announcement)
@if ($announcement['sponsor_logo_url'] ?? null) @endif
@if ($announcement['title'] ?? null)

{{ $announcement['title'] }}

@endif

{{ $announcement['message'] }}

@endforeach
@endif