diff --git a/assets/styles/app.css b/assets/styles/app.css index e870a69..52e4de9 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -487,19 +487,34 @@ body { color: #16a34a; } +/* ── Game card ── */ + +.game-container { + max-width: fit-content; + margin: 56px auto; + padding: 24px 32px 32px; + background: var(--surface); + border: 1px solid var(--border); + border-radius: var(--radius-lg); + box-shadow: 0 4px 32px var(--shadow-warm); +} + +.game-container #actors { + margin: 16px auto 0; +} + /* ── Game actions ── */ .game-actions { display: flex; - justify-content: flex-end; - padding: 12px 40px 0; + justify-content: flex-start; } .btn-abandon { padding: 7px 16px; background: none; - color: var(--text-muted); - border: 1.5px solid var(--border); + color: #dc2626; + border: 1.5px solid #dc2626; border-radius: 100px; font-family: 'Inter', sans-serif; font-size: 13px; diff --git a/src/EventListener/AbandonAnonymousGameOnLoginListener.php b/src/EventListener/AbandonAnonymousGameOnLoginListener.php new file mode 100644 index 0000000..267fa92 --- /dev/null +++ b/src/EventListener/AbandonAnonymousGameOnLoginListener.php @@ -0,0 +1,39 @@ +getRequest()->getSession(); + $gameId = $session->get('current_game_id'); + + if (!$gameId) { + return; + } + + $game = $this->gameRepository->find($gameId); + + if ($game && $game->getStatus() === Game::STATUS_IN_PROGRESS) { + $game->abandon(); + $this->em->flush(); + } + + $session->remove('current_game_id'); + } +} diff --git a/templates/homepage/index.html.twig b/templates/homepage/index.html.twig index 6cb0df7..ee0e2b1 100644 --- a/templates/homepage/index.html.twig +++ b/templates/homepage/index.html.twig @@ -2,18 +2,20 @@ {% block body %} {% if game %} -
-
- - -
-
+
+
+
+ + +
+
-
+
+
{% else %}