@extends('layouts.app') @push('styles') @endpush @section('title', 'Lobby - GIGAX ARENA') @section('page_title', 'Lobby') @php $waitingMatches = collect($activeLobbies ?? []); $runningMatches = collect($liveMatches ?? []); $lobbyMatches = $runningMatches ->concat($waitingMatches) ->unique(fn ($match) => ($match->status ?? '') . ':' . ($match->id ?? '')) ->values(); $totalMatches = $lobbyMatches->count(); $liveTotal = $runningMatches->count(); $waitingTotal = $waitingMatches->count(); // GIGAX: somente para exibir os comandos administrativos nos cards. $gxLobbyUserId = (int) (session('user_id') ?? auth()->id() ?? 0); $gxLobbyUserRole = $gxLobbyUserId ? (string) (\Illuminate\Support\Facades\DB::table('users')->where('id', $gxLobbyUserId)->value('role') ?? '') : ''; $gxLobbyIsAdmin = $gxLobbyUserRole === 'admin'; $avatarUrl = static function ($player) { $url = trim((string) ($player->avatar_url ?? '')); return $url !== '' ? $url : asset('default-avatar.png'); }; // Ranking lateral: usa a mesma base real de XP do projeto. $gxLobbyRanking = collect(); try { if (\Illuminate\Support\Facades\Schema::hasTable('gx_player_experience') && \Illuminate\Support\Facades\Schema::hasTable('users')) { $gxLobbyRanking = \Illuminate\Support\Facades\DB::table('gx_player_experience as x') ->join('users as u', 'u.id', '=', 'x.user_id') ->where('x.monthly_xp', '>', 0) ->orderByDesc('x.monthly_xp') ->orderBy('u.nickname') ->limit(10) ->get([ 'u.id as user_id', 'u.nickname', 'u.avatar_url', 'x.level', 'x.monthly_xp as xp', ]); } } catch (\Throwable $e) { $gxLobbyRanking = collect(); } // GIGAX_RANKING_MODALIDADES_V17: ranking fechado, isolado do PUG/Skill. $gxModeRankings = collect(); $gxModeKeys = ['custom_x1','custom_x2','custom_x3','custom_x4','custom_x5','custom_x6','custom_x7','custom_x8','team_5l','c1s','awp']; try { if (\Illuminate\Support\Facades\Schema::hasTable('gigax_player_mode_stats') && \Illuminate\Support\Facades\Schema::hasTable('users')) { $gxModeRankings = \Illuminate\Support\Facades\DB::table('gigax_player_mode_stats as s') ->join('users as u','u.id','=','s.user_id') ->whereIn('s.mode_code',$gxModeKeys) ->select('s.user_id','s.mode_code as mode_key','s.matches_played','s.wins','s.losses','s.kills','s.deaths','s.headshots','s.points','s.rating','s.current_streak','u.nickname','u.avatar_url') ->orderByDesc('s.points')->orderByDesc('s.wins')->get()->groupBy('mode_key'); } } catch (\Throwable $e) { $gxModeRankings = collect(); } $gxPlacementMatches = 0; $gxCurrentSkill = 1; try { if ($gxLobbyUserId > 0) { $gxCurrentSkill = (int) (\Illuminate\Support\Facades\DB::table('users')->where('id',$gxLobbyUserId)->value('skill_level') ?? 1); if (\Illuminate\Support\Facades\Schema::hasTable('mix_ranking_modes')) { $gxPlacementMatches = min(10, (int) (\Illuminate\Support\Facades\DB::table('mix_ranking_modes')->where('user_id',$gxLobbyUserId)->where('game_slug','crossfire')->where('queue_mode','casual')->value('matches_played') ?? 0)); } } } catch (\Throwable $e) {} @endphp @push('styles') /* GIGAX_V54_EXACT_LOBBY_BODY_BEGIN */ /* Fila entre header e corpo: 3 cards horizontais, compactos e sempre alinhados */ .gx-v53-queues{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;width:100%!important;min-width:0!important;padding:10px 12px 0!important;box-sizing:border-box!important;background:transparent!important} .gx-v53-queue{height:92px!important;min-width:0!important;box-sizing:border-box!important;border:1px solid rgba(69,126,164,.34)!important;border-radius:9px!important;background:linear-gradient(180deg,#081b29 0%,#061521 100%)!important;padding:10px 14px!important;display:grid!important;grid-template-rows:22px 1fr 18px!important;align-items:center!important;overflow:hidden!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.015)!important} .gx-v53-qtitle{display:flex!important;align-items:center!important;gap:7px!important;font-size:11px!important;line-height:1!important;font-weight:950!important;letter-spacing:.01em!important}.gx-v53-qtitle span{font-size:16px!important;line-height:1!important} .gx-v53-open .gx-v53-qtitle{color:#25bfff!important}.gx-v53-advanced .gx-v53-qtitle{color:#ffd51d!important}.gx-v53-pro .gx-v53-qtitle{color:#e65cff!important} .gx-v53-slots{display:flex!important;justify-content:center!important;align-items:center!important;gap:7px!important;min-width:0!important;height:22px!important}.gx-v53-slot{display:block!important;width:13px!important;height:16px!important;position:relative!important;flex:0 0 13px!important}.gx-v53-slot:before{content:''!important;position:absolute!important;left:4px!important;top:0!important;width:5px!important;height:5px!important;border:1.5px solid #42647d!important;border-radius:50%!important;box-sizing:border-box!important}.gx-v53-slot:after{content:''!important;position:absolute!important;left:1px!important;bottom:0!important;width:11px!important;height:7px!important;border:1.5px solid #42647d!important;border-radius:7px 7px 2px 2px!important;box-sizing:border-box!important}.gx-v53-slot.on:before,.gx-v53-slot.on:after{border-color:#20e59a!important;background:rgba(32,229,154,.16)!important} .gx-v53-count{display:block!important;text-align:center!important;color:#f5f9fd!important;font-size:10px!important;line-height:1!important;font-weight:950!important} /* Estrutura principal: corpo + ranking. Nunca deixa ranking sobrepor cards */ .gx-lobby-page{display:grid!important;grid-template-columns:minmax(0,1fr) 286px!important;gap:12px!important;align-items:start!important;width:100%!important;min-width:0!important} .gx-lobby-main,.gx-lobby-unified,.gx-lobby-compact{min-width:0!important;width:100%!important;box-sizing:border-box!important} .gx-lobby-unified{display:flex!important;flex-direction:column!important;gap:10px!important;border:0!important;background:transparent!important;overflow:visible!important} /* Barra de modos */ .gx-lobby-toolbar{min-height:70px!important;margin:0!important;padding:9px 12px!important;border:1px solid rgba(59,118,153,.32)!important;border-radius:10px!important;background:linear-gradient(180deg,#071b27,#06151f)!important;box-sizing:border-box!important} .gx-lobby-toolbar .gx-partidas-title{font-size:20px!important;line-height:1!important;font-weight:1000!important;color:#f4f9fc!important;letter-spacing:.01em!important}.gx-lobby-toolbar .gx-lobby-heading-copy p{margin-top:4px!important;font-size:9px!important;line-height:1.2!important;color:#9fb5c6!important;font-weight:650!important} /* 3 partidas por linha, cards maiores mas compactos */ .gx-lobby-compact{padding:0!important} .gx-lobby-unified .gx-mini-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;width:100%!important;min-width:0!important;overflow:visible!important;padding:0!important;align-items:stretch!important} .gx-lobby-unified .gx-mini-card{position:relative!important;display:block!important;flex:none!important;width:100%!important;min-width:0!important;max-width:none!important;height:255px!important;min-height:255px!important;margin:0!important;padding:0!important;border:1px solid rgba(61,123,160,.40)!important;border-radius:10px!important;background:linear-gradient(160deg,#071b27 0%,#05131e 100%)!important;box-shadow:0 7px 18px rgba(0,0,0,.16)!important;overflow:visible!important;box-sizing:border-box!important} .gx-lobby-unified .gx-mini-card:hover{border-color:rgba(22,227,151,.58)!important} .gx-lobby-unified .gx-mini-body{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;width:100%!important;height:100%!important;min-height:0!important;padding:10px 11px!important;box-sizing:border-box!important} .gxclean-head{display:flex!important;align-items:center!important;justify-content:space-between!important;width:100%!important;min-width:0!important;padding:0!important;border:0!important;background:transparent!important}.gxclean-title{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important;padding-right:34px!important}.gxclean-title strong{font-size:12px!important;line-height:1.15!important;font-weight:1000!important;color:#f8fbfe!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-shadow:0 1px 0 #000!important}.gxclean-title strong em{font-size:8px!important;color:#1bdcf4!important;font-style:normal!important;margin-left:3px!important}.gxclean-title small{height:22px!important;min-width:40px!important;padding:0 7px!important;border:1px solid #14df92!important;border-radius:7px!important;background:rgba(15,176,111,.10)!important;color:#eafff6!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:10px!important;font-weight:1000!important} .gx-card-menu{position:absolute!important;top:8px!important;right:8px!important;z-index:30!important}.gx-card-menu summary{width:29px!important;height:29px!important;border:1px solid rgba(17,193,208,.34)!important;border-radius:7px!important;background:#073143!important;color:#1be1d4!important;font-size:18px!important;display:grid!important;place-items:center!important} /* Miolo limpo, sem linhas internas */ .gx-mini-meta{order:3!important;display:flex!important;justify-content:center!important;align-items:center!important;min-height:14px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important}.gx-mini-meta>div{display:none!important}.gx-mini-meta>div:first-child{display:flex!important;align-items:center!important;gap:4px!important;border:0!important;background:transparent!important;padding:0!important}.gx-mini-meta>div:first-child span{display:none!important}.gx-mini-meta>div:first-child b{font-size:8px!important;color:#91aabd!important;font-weight:750!important}.gx-mini-meta>div:first-child b:before{content:'⌖ '!important;color:#6e9dbb!important} .gxclean-faceoff{order:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)!important;gap:6px!important;align-items:start!important;width:100%!important;min-width:0!important;flex:1 1 auto!important;padding:4px 0 0!important;border:0!important;background:transparent!important}.gxclean-squad{display:flex!important;flex-direction:column!important;min-width:0!important;align-items:stretch!important}.gxclean-squad-name{display:flex!important;flex-direction:column!important;align-items:center!important;gap:4px!important;min-height:42px!important;margin:0 0 4px!important;padding:0!important;border:0!important}.gxclean-squad-name span:first-child{max-width:100%!important;font-size:10.5px!important;line-height:1.1!important;font-weight:1000!important;color:#f4f8fc!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:center!important}.gxclean-squad-name span:last-child{min-width:34px!important;height:22px!important;padding:0 6px!important;border-radius:6px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;background:#096abe!important;color:#fff!important;font-size:10px!important;font-weight:1000!important}.gxclean-b .gxclean-squad-name span:last-child{background:#b96600!important}.gxclean-vs{align-self:center!important;margin-top:34px!important;color:#a9c9dd!important;font-size:11px!important;font-weight:1000!important;text-align:center!important}.gxclean-avatars.gx-player-list{display:flex!important;flex-direction:column!important;gap:3px!important;min-width:0!important;align-items:stretch!important}.gx-player-row{display:flex!important;align-items:center!important;gap:5px!important;min-width:0!important;height:20px!important;padding:0!important;border:0!important;background:transparent!important}.gx-avatar-mini{width:18px!important;height:18px!important;min-width:18px!important;border-radius:50%!important;border:1px solid rgba(22,227,151,.78)!important;background:#09202c!important;font-size:7px!important;overflow:hidden!important}.gx-avatar-mini img{width:100%!important;height:100%!important;object-fit:cover!important}.gx-player-name{min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:#f1f6fa!important;font-size:9px!important;line-height:1!important;font-weight:800!important}.gx-player-empty .gx-avatar-mini{border-color:#355b74!important;color:#789ab2!important;background:transparent!important}.gx-player-empty .gx-player-name{color:#7895aa!important;font-weight:650!important} .gxclean-footer{order:4!important;display:grid!important;grid-template-columns:minmax(0,1fr) max-content max-content max-content!important;gap:4px!important;align-items:center!important;width:100%!important;min-width:0!important;margin-top:auto!important;padding:0!important;border:0!important;background:transparent!important;overflow:hidden!important}.gxclean-status strong{display:none!important}.gxclean-status small{height:23px!important;max-width:100%!important;padding:0 8px!important;border-radius:999px!important;background:rgba(0,170,105,.22)!important;color:#29f1a2!important;font-size:7px!important;font-weight:1000!important;display:inline-flex!important;align-items:center!important;white-space:nowrap!important}.gxclean-count,.gxclean-count b{font-size:8px!important;color:#e8f2f8!important;font-weight:900!important;white-space:nowrap!important}.gx-report-v21,.gx-direct-delete-v16{height:23px!important;padding:0 6px!important;font-size:6.5px!important;font-weight:1000!important;white-space:nowrap!important}.gx-report-v21{color:#ffd52e!important;border-color:#9b7900!important;background:rgba(110,85,0,.12)!important}.gx-direct-delete-v16{color:#ff6e87!important;border-color:#963047!important;background:rgba(114,25,44,.12)!important} /* Ranking lateral sempre visível no desktop */ .gx-ranking-side{display:block!important;width:286px!important;min-width:286px!important;max-width:286px!important;position:sticky!important;top:10px!important;align-self:start!important;overflow:hidden!important;border-radius:10px!important}.gx-ranking-side.gx-rankfx .gx-ranking-side-head h3{font-size:13px!important}.gx-ranking-side.gx-rankfx .gx-ranking-side-head p{font-size:8px!important}.gx-ranking-side.gx-rankfx .gx-rankfx-player b{font-size:10.5px!important}.gx-ranking-side.gx-rankfx .gx-rankfx-player small{font-size:8px!important}.gx-ranking-side.gx-rankfx .gx-rank-item{min-height:43px!important;padding-top:5px!important;padding-bottom:5px!important} /* Mostrar PUG e MODALIDADES juntos no painel lateral, como a referência */ .gx-r17-main-tabs{display:none!important}.gx-ranking-side [data-r17-panel="pug"]{display:block!important}.gx-ranking-side [data-r17-panel="modes"]{display:block!important;border-top:1px solid rgba(74,133,168,.25)!important;margin-top:8px!important;padding-top:7px!important}.gx-ranking-side [data-r17-panel="modes"]:before{content:'🎮 RANKING MODALIDADES'!important;display:block!important;padding:3px 9px 8px!important;color:#f5f9fd!important;font-size:11px!important;font-weight:1000!important;letter-spacing:.02em!important}.gx-r17-mode-tabs{display:flex!important;overflow-x:auto!important;gap:4px!important;padding:0 8px 7px!important;scrollbar-width:none!important}.gx-r17-mode-tabs::-webkit-scrollbar{display:none!important}.gx-r17-mode-tabs button{flex:0 0 auto!important;min-width:34px!important;height:24px!important;padding:0 7px!important;font-size:7.5px!important}.gx-r17-mode-head{padding:5px 8px!important}.gx-r17-mode-head b{font-size:9px!important}.gx-r17-mode-head small{font-size:7px!important} /* Paginação 6 por página = 3 por linha x 2 linhas */ .gx-v54-pagination{display:flex!important;justify-content:center!important;align-items:center!important;gap:6px!important;margin:10px 0 2px!important}.gx-v54-page{width:29px!important;height:29px!important;border:1px solid rgba(76,131,166,.32)!important;border-radius:6px!important;background:#071b27!important;color:#a9c2d4!important;font-size:10px!important;font-weight:900!important;cursor:pointer!important}.gx-v54-page.is-active{background:#16e397!important;color:#03140e!important;border-color:#16e397!important;box-shadow:0 0 14px rgba(22,227,151,.18)!important}.gx-load-wrap{display:none!important} @media(max-width:1120px){.gx-lobby-page{grid-template-columns:minmax(0,1fr) 250px!important}.gx-ranking-side{width:250px!important;min-width:250px!important;max-width:250px!important}.gx-lobby-unified .gx-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.gx-player-name{font-size:8.3px!important}.gxclean-footer{gap:3px!important}.gx-report-v21,.gx-direct-delete-v16{padding:0 5px!important;font-size:6px!important}} @media(max-width:900px){.gx-lobby-page{grid-template-columns:1fr!important}.gx-ranking-side{position:relative!important;width:100%!important;min-width:0!important;max-width:none!important}.gx-lobby-unified .gx-mini-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.gx-v53-queues{grid-template-columns:1fr!important}.gx-v53-queue{height:78px!important}} @media(max-width:620px){.gx-lobby-unified .gx-mini-grid{grid-template-columns:1fr!important}.gxclean-footer{grid-template-columns:minmax(0,1fr) max-content max-content!important}.gx-v53-queues{padding-left:0!important;padding-right:0!important}} /* GIGAX_V54_EXACT_LOBBY_BODY_END */ @endpush @section('content')
{{-- GIGAX_V53_LIVE_QUEUES_BEGIN --}}
♙MIX OPEN
0/10
♙MIX ADVANCED
0/10
♙MIX PRO
0/10
{{-- GIGAX_V53_LIVE_QUEUES_END --}}
⚔

PARTIDAS

{{ $totalMatches }} partida{{ $totalMatches === 1 ? '' : 's' }} • {{ $waitingTotal }} disponível{{ $waitingTotal === 1 ? '' : 'is' }} • {{ $liveTotal }} ao vivo

{{-- GIGAX_CUSTOM_MODES_V3 --}} @include('components.gigax-custom-modes')
@forelse($lobbyMatches as $index => $match) @php $isLive = (string) ($match->status ?? '') === 'in_progress'; $currentPlayers = (int) ($match->current_players ?? 0); $maxPlayers = max(1, (int) ($match->max_players ?? 10)); $gxTeamCapacity = max(1, min(8, (int) ceil(max(2, $maxPlayers) / 2))); // V40: 5v5=5 por time, 8v8=8 por time $gameSlug = strtoupper((string) ($match->game_slug ?? 'crossfire')); $statusLabel = match((string) ($match->status ?? 'waiting')) { 'in_progress' => 'Ao vivo', 'ready_check' => 'Confirmação', 'veto' => 'Veto', default => 'Aguardando', }; $teamA = collect($match->left_players ?? [])->take(8); $teamB = collect($match->right_players ?? [])->take(8); $teamAName = (string) ($match->left_team ?? 'Time A'); $teamBName = (string) ($match->right_team ?? 'Time B'); $modeLabel = strtoupper(str_replace(['_', 'x'], [' ', ' x '], (string) ($match->training_type ?: 'MIX 5V5'))); $gxIsC1s = strtolower(trim((string) ($match->training_type ?? ''))) === 'c1s'; $gxIsHost = (int) ($match->host_id ?? 0) === $gxLobbyUserId; $gxCanStartC1s = $gxIsC1s && !$isLive && (string) ($match->status ?? 'waiting') === 'waiting' && $gxIsHost && $currentPlayers >= 2; @endphp
= 12 ? 'hidden' : '' }}>
{{ mb_strtoupper((string)($match->title ?? $match->name ?? 'SALA')) }} #{{ $match->id }} {{ $gxTeamCapacity }}v{{ $gxTeamCapacity }}
⋮
Partida #{{ (int) $match->id }} DETALHES @if($isLive) ASSISTIR @elseif($gxCanStartC1s) @elseif(!$gxIsHost && (string) ($match->status ?? 'waiting') === 'waiting')
@csrf
@elseif($gxIsHost && $gxIsC1s && $currentPlayers < 2) @endif @if($gxIsHost && (string) ($match->status ?? 'waiting') === 'waiting') SUA SALA @endif @if($gxLobbyIsAdmin) MANUTENÇÃO @if($isLive) @endif @if((string) ($match->status ?? 'waiting') === 'waiting' && empty($match->started_at)) @endif @endif
Mapa{{ $match->map_name ?: 'A definir' }}
Modo{{ $modeLabel }}
Jogadores{{ $currentPlayers }}/{{ $maxPlayers }}
{{ $teamAName }}{{ (int) ($match->team_a_count ?? $teamA->count()) }}/{{ $gxTeamCapacity }}
@foreach($teamA as $player) @php $name = $player->nickname ?? 'Jogador'; @endphp
{{ $name }} {{ $name }}
@endforeach @for($i = $teamA->count(); $i < $gxTeamCapacity; $i++)
+Vaga
@endfor
VS
{{ $teamBName }}{{ (int) ($match->team_b_count ?? $teamB->count()) }}/{{ $gxTeamCapacity }}
@foreach($teamB as $player) @php $name = $player->nickname ?? 'Jogador'; @endphp
{{ $name }} {{ $name }}
@endforeach @for($i = $teamB->count(); $i < $gxTeamCapacity; $i++)
+Vaga
@endfor
@empty
Nenhuma partida disponível. Use JOGAR AGORA para entrar na Fila MIX.
@endforelse
@if($totalMatches > 12)
@endif
{{-- GIGAX_RANKING_MODALIDADES_V17 --}}
{{-- GIGAX_LOBBY_JOIN_PASSWORD_V8_BEGIN --}} {{-- GIGAX_LOBBY_JOIN_PASSWORD_V8_END --}} {{-- GIGAX_LOBBY_READY_MODAL_BEGIN --}} {{-- GIGAX_LOBBY_READY_MODAL_END --}} {{-- GIGAX_LOBBY_ALIGNED_MENU_V34_BEGIN --}} {{-- GIGAX_LOBBY_ALIGNED_MENU_V34_END --}} {{-- GIGAX_LOBBY_CLEAN_V45_BEGIN --}} {{-- GIGAX_LOBBY_CLEAN_V45_END --}} {{-- GIGAX_LOBBY_GRID_V52_BEGIN --}} {{-- GIGAX_LOBBY_GRID_V52_END --}} {{-- GIGAX_DIRECT_DELETE_V16_SCRIPT --}} @endsection @push('scripts') @endpush {{-- GIGAX_LOBBY_MODAL_RUNTIME_V3_BEGIN --}} {{-- GIGAX_LOBBY_MODAL_RUNTIME_V3_END --}} {{-- GIGAX_OPEN_MATCH_MODAL_CARD_V1_SCRIPT --}} {{-- GIGAX_RANKING_PUG_GREEN_VISIBLE_V2 --}} {{-- GIGAX_LOBBY_TOOLBAR_V34_BEGIN --}} {{-- GIGAX_LOBBY_TOOLBAR_V34_END --}} {{-- GIGAX_REPORTAR_UI_V21 --}}