/* ── Blackjack Table ── */

.blackjack-table {
  background: linear-gradient(145deg, #0d3b1e, #1a5c2a 40%, #1e6b32 70%, #0d3b1e);
  border-radius: var(--radius-lg, 16px);
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  box-shadow:
    inset 0 2px 20px rgba(0, 0, 0, 0.3),
    0 4px 24px rgba(0, 0, 0, 0.2);
  border: 3px solid #2a4a35;
}

/* ── Stats Bar ── */
.bj-stats-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bj-stat {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bj-stat-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.bj-stat-value.bankroll {
  color: #ffd700;
}

.bj-btn-reset {
  align-self: center;
  width: 36px;
  height: 36px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.5);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bj-btn-reset:hover {
  background: rgba(192, 57, 43, 0.8);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.bj-btn-reset:active {
  transform: scale(0.95);
}

/* ── Dealer / Player Areas ── */
.bj-area {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.bj-area-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}

.bj-hand-total {
  display: inline-block;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  min-width: 36px;
}

.bj-hand-total.bust {
  background: rgba(192, 57, 43, 0.8);
}

.bj-hand-total.blackjack {
  background: rgba(243, 156, 18, 0.8);
  color: #000;
}

.bj-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 100px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.bj-cards .playing-card {
  width: clamp(48px, 7vw, 72px);
  transition: transform 0.2s ease;
}

/* ── Divider ── */
.bj-divider {
  width: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 2px 0;
}

/* ── Result Banner ── */
.bj-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.bj-result.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.bj-result.win { color: #2ecc71; }
.bj-result.lose { color: #e74c3c; }
.bj-result.push { color: #f1c40f; }
.bj-result.blackjack { color: #ffd700; text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }

/* ── Betting Area ── */
.bj-betting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.bj-bet-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
}

.bj-bet-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
}

.bj-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.bj-chip {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.bj-chip:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bj-chip:active {
  transform: scale(0.95);
}

.bj-chip.chip-10 { background: #2980b9; }
.bj-chip.chip-25 { background: #27ae60; }
.bj-chip.chip-50 { background: #e74c3c; }
.bj-chip.chip-100 { background: #2c3e50; }
.bj-chip.chip-clear {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 0.68rem;
}

/* ── Action Buttons ── */
.bj-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0;
}

.bj-btn {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bj-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bj-btn:active:not(:disabled) {
  transform: translateY(0);
}

.bj-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bj-btn-hit {
  background: #27ae60;
  color: #fff;
}
.bj-btn-hit:hover:not(:disabled) { background: #2ecc71; }

.bj-btn-stand {
  background: #e74c3c;
  color: #fff;
}
.bj-btn-stand:hover:not(:disabled) { background: #c0392b; }

.bj-btn-double {
  background: #f39c12;
  color: #fff;
}
.bj-btn-double:hover:not(:disabled) { background: #e67e22; }

.bj-btn-split {
  background: #8e44ad;
  color: #fff;
}
.bj-btn-split:hover:not(:disabled) { background: #9b59b6; }

.bj-btn-deal {
  background: #ffd700;
  color: #1a1a2e;
  padding: 10px 32px;
  font-size: 1rem;
}
.bj-btn-deal:hover:not(:disabled) { background: #ffed4a; }

.bj-btn-new {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.bj-btn-new:hover:not(:disabled) { background: rgba(255, 255, 255, 0.25); }

/* ── Disclaimer ── */
.bj-disclaimer {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.65rem;
  text-align: center;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ── Split Hands ── */
.bj-split-container {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.bj-split-hand {
  flex: 1;
  max-width: 260px;
  padding: 6px;
  border-radius: 8px;
}

.bj-split-hand.active-hand {
  background: rgba(255, 255, 255, 0.06);
  outline: 1px solid rgba(255, 215, 0, 0.3);
}

/* ── Tablet ── */
@media (max-width: 768px) {
  .blackjack-table {
    padding: 14px 10px;
    gap: 4px;
  }

  .bj-stats-bar { gap: 14px; }
  .bj-stat { font-size: 0.68rem; }
  .bj-stat-value { font-size: 1rem; }
  .bj-bet-amount { font-size: 1.3rem; }
  .bj-result { font-size: 1.1rem; padding: 10px 24px; }

  .bj-chip {
    width: 42px;
    height: 42px;
    font-size: 0.72rem;
  }

  .bj-btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .bj-btn-deal {
    padding: 9px 28px;
    font-size: 0.92rem;
  }

  .bj-cards {
    gap: 4px;
    min-height: 80px;
  }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .blackjack-table {
    padding: 10px 6px;
    border-radius: 12px;
    gap: 3px;
  }

  .bj-stats-bar { gap: 10px; padding-bottom: 4px; }
  .bj-stat { font-size: 0.62rem; }
  .bj-stat-value { font-size: 0.9rem; }

  .bj-area-label { font-size: 0.65rem; margin-bottom: 1px; }
  .bj-hand-total { font-size: 0.78rem; padding: 2px 10px; margin-bottom: 2px; }

  .bj-cards {
    min-height: 65px;
    gap: 3px;
    padding: 2px 0;
  }

  .bj-divider { margin: 1px 0; }

  .bj-betting { gap: 6px; padding: 2px 0; }
  .bj-bet-label { font-size: 0.75rem; }
  .bj-bet-amount { font-size: 1.1rem; }

  .bj-chip {
    width: 38px;
    height: 38px;
    font-size: 0.65rem;
    border-width: 2px;
  }

  .bj-chips { gap: 6px; }

  .bj-actions { gap: 5px; padding: 2px 0; }

  .bj-btn {
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .bj-btn-deal {
    padding: 8px 24px;
    font-size: 0.85rem;
  }

  .bj-result { font-size: 0.95rem; padding: 8px 20px; }

  .bj-split-container {
    flex-direction: column;
    gap: 8px;
  }
}
