@(player: de.knockoutwhist.player.AbstractPlayer, gamelobby: logic.game.GameLobby)

<div id="selecttrumpsuit" class="game-field game-field-background">
    <div class="ingame-stage blur-sides">
        <div class="container py-4">
            <div class="row justify-content-center">
                <div class="col-12">
                    <div class="card shadow-sm">
                        <div class="card-header text-center">
                            <h3 class="mb-0">Select Trump Suit</h3>
                        </div>
                        <div class="card-body">
                            @if(gamelobby.logic.getCurrentMatch.isDefined) {
                                @if(player.equals(gamelobby.logic.getCurrentMatch.get.roundlist.last.winner.get)) {
                                    <div class="alert alert-info" role="alert" aria-live="polite">
                                        You (@player.toString) won the last round. Choose the trump suit for the next round.
                                    </div>

                                    <div class="row justify-content-center col-auto mb-5">
                                        <div class="col-auto handcard">
                                            <div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="0" style="border-radius: 6px" onclick="handleTrumpSelection(this)">
                                                @util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Spades))
                                                width="120px" style="border-radius: 6px"/>
                                            </div>
                                        </div>
                                        <div class="col-auto handcard">
                                            <div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="1" style="border-radius: 6px" onclick="handleTrumpSelection(this)">
                                                @util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Hearts))
                                                width="120px" style="border-radius: 6px"/>
                                            </div>
                                        </div>
                                        <div class="col-auto handcard">
                                            <div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="2" style="border-radius: 6px" onclick="handleTrumpSelection(this)">
                                                @util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Diamonds))
                                                width="120px" style="border-radius: 6px"/>
                                            </div>
                                        </div>
                                        <div class="col-auto handcard">
                                            <div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="3" style="border-radius: 6px" onclick="handleTrumpSelection(this)">
                                                @util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Clubs))
                                                width="120px" style="border-radius: 6px"/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row justify-content-center ingame-cards-slide" id="card-slide">
                                    @for(i <- player.currentHand().get.cards.indices) {
                                        <div class="col-auto" style="border-radius: 6px">
                                            @util.WebUIUtils.cardtoImage(player.currentHand().get.cards(i)) width="120px" style="border-radius: 6px"/>
                                        </div>
                                    }
                                    </div>
                                } else {
                                    <div class="alert alert-warning" role="alert" aria-live="polite">
                                        @gamelobby.logic.getCurrentMatch.get.roundlist.last.winner.get.name
                                        is choosing a trumpsuit. The new round will start once a suit is picked.
                                    </div>
                                }
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    connectWebSocket()
</script>