/* ---------- Setup screen additions ---------- */

#setup-screen {
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.stake-note {
  text-align: center;
  color: var(--text-warm);
  font-style: italic;
  margin: 0.5rem 0 1.2rem;
  font-size: 0.9rem;
}

/* ---------- Layout ---------- */

.bj-layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 820px) {
  .bj-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Dealer ---------- */

.dealer-row {
  text-align: center;
  width: 100%;
}

.dealer-label {
  font-family: 'MedievalSharp', cursive;
  color: var(--ale-gold);
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
}

#dealer-total {
  font-size: 1rem;
  color: var(--parchment);
  opacity: 0.85;
}

/* ---------- Cards ---------- */

.hand {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 84px;
}

.card {
  width: 56px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--parchment), var(--parchment-edge));
  border: 2px solid var(--wood-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.card .rank {
  font-size: 1.25rem;
  line-height: 1;
}

.card .suit {
  font-size: 1.3rem;
  line-height: 1;
}

.card.red { color: #a3231f; }
.card.black { color: #1b1b1b; }

.card.face-down {
  background: repeating-linear-gradient(
    45deg,
    var(--wood-mid) 0 6px,
    var(--wood-dark) 6px 12px
  );
  border-color: var(--wood-dark);
  color: transparent;
  position: relative;
}

.card.face-down::after {
  content: "🍺";
  position: absolute;
  font-size: 1.3rem;
  opacity: 0.65;
}

/* ---------- Players ---------- */

.players-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  width: 100%;
}

.player-panel {
  background: linear-gradient(180deg, var(--parchment), var(--parchment-edge));
  border: 3px solid var(--wood-dark);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  min-width: 160px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.player-panel.active-turn {
  border-color: var(--ale-gold);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 184, 77, 0.6);
}

.player-panel.out {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.player-panel .p-name {
  font-family: 'MedievalSharp', cursive;
  color: var(--text-warm);
  display: block;
  margin-bottom: 0.15rem;
}

.player-panel .p-gold {
  color: var(--ember);
  font-weight: 600;
}

.player-panel .p-bet {
  font-size: 0.85rem;
  color: var(--text-warm);
  opacity: 0.8;
  display: block;
}

.player-panel .p-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.4rem;
  color: var(--text-warm);
}

.player-panel .hand {
  margin-top: 0.6rem;
  min-height: 64px;
}

/* ---------- Table message ---------- */

.table-message {
  color: var(--ale-gold);
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
}

/* ---------- Betting ---------- */

.bet-row {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 480px;
}

.bet-player {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--parchment);
}

.bet-player-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.bet-name {
  font-family: 'MedievalSharp', cursive;
  color: var(--ale-gold);
}

.bet-gold {
  font-size: 0.85rem;
  opacity: 0.85;
}

.bet-choices {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.bet-choice-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 2px solid var(--wood-dark);
  background: linear-gradient(180deg, var(--wood-light), var(--wood-mid));
  color: var(--parchment-edge);
  cursor: pointer;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
}

.bet-choice-btn.selected {
  background: linear-gradient(180deg, var(--ember), #8f2e07);
  color: var(--parchment);
}

.bet-leave-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--parchment-edge);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'EB Garamond', Georgia, serif;
}

.deal-btn {
  align-self: center;
}

.round-controls {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ---------- Leaderboard ---------- */

.leaderboard-card {
  background: linear-gradient(180deg, var(--parchment), var(--parchment-edge));
  border: 3px solid var(--wood-dark);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  color: var(--text-warm);
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.leaderboard-card h2 {
  font-family: 'MedievalSharp', cursive;
  margin-top: 0;
  font-size: 1.15rem;
  text-align: center;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--ember);
  width: 1.8rem;
  flex-shrink: 0;
}

.leaderboard-name {
  flex: 1;
  text-align: left;
}

.leaderboard-score {
  font-weight: 600;
}

.leaderboard-empty {
  text-align: center;
  opacity: 0.7;
  font-style: italic;
  justify-content: center !important;
}

.leaderboard-new {
  background: rgba(217, 164, 65, 0.3);
  border-radius: 4px;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
