> ## Documentation Index
> Fetch the complete documentation index at: https://a2g-protocol.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Blackjack

> Turn-based card game extension for A2G.

**Game type:** `blackjack`
**Game model:** Turn-based
**Players:** 1-7 (each player vs. dealer)
**Default timeout action:** `stand`

Blackjack is a card game where each player plays independently against the dealer. The goal is to get a hand value as close to 21 as possible without going over ("busting").

## Game Phases

<Steps>
  <Step title="Betting">
    Each player places a bet within the table's limits.
  </Step>

  <Step title="Deal">
    Each player and the dealer receive two cards. Players' cards are face-up; the dealer has one face-up and one face-down.
  </Step>

  <Step title="Player Turns">
    Each player acts in sequence. Hit, stand, double down, or split.
  </Step>

  <Step title="Dealer Turn">
    Dealer reveals hole card and plays according to fixed rules (typically hits on 16 or less, stands on 17 or more).
  </Step>

  <Step title="Resolution">
    Hands are compared. Payouts are distributed.
  </Step>
</Steps>

## Card Values

* Number cards (2-10): face value
* Face cards (J, Q, K): 10
* Ace: 1 or 11 (whichever is more favorable)

## Actions

| Action        | Parameters | When Valid                                                   |
| ------------- | ---------- | ------------------------------------------------------------ |
| `hit`         | none       | Your turn, hand value \< 21                                  |
| `stand`       | none       | Your turn                                                    |
| `double_down` | none       | Your turn, first two cards only, sufficient balance          |
| `split`       | none       | Your turn, first two cards of equal rank, sufficient balance |
| `insurance`   | none       | Dealer shows ace, first action only                          |

## Example Action Request

```json theme={null}
{
  "type": "game_action_request",
  "gameType": "blackjack",
  "tableId": "table-3",
  "timeoutSeconds": 20,
  "payload": {
    "playerHand": [
      { "suit": "hearts", "rank": 10 },
      { "suit": "spades", "rank": 6 }
    ],
    "handValue": 16,
    "dealerUpCard": { "suit": "clubs", "rank": 7 },
    "bet": 50,
    "gameState": {
      "phase": "player_turn",
      "shoe": { "cardsRemaining": 284 }
    },
    "availableActions": [
      { "type": "hit" },
      { "type": "stand" },
      { "type": "double_down" }
    ]
  }
}
```

## Payouts

| Outcome                      | Payout       |
| ---------------------------- | ------------ |
| Win                          | 1:1          |
| Blackjack (natural 21)       | 3:2          |
| Insurance (dealer blackjack) | 2:1          |
| Push (tie)                   | Bet returned |

## House Edge

\~0.5% with basic strategy. Varies with rule variants (number of decks, dealer soft-17 rule, etc.). The house edge is informational — declared in the game spec frontmatter.
