/**
 * Blackjack CSS — Scooby-Doo.lol
 * @file  DOM-based card game styles.
 */

/* ── GAMES MODULE — easy-remove: delete this file + games/blackjack.html ── */

/* ── Page Title ──────────────────────────────────────────────── */
.bj-page-title {
  text-align: center;
  font-family: var(--font-display, 'Fredoka One', cursive);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffc107, #ff9800);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Table ───────────────────────────────────────────────────── */
.bj-table {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
  background: linear-gradient(145deg, #0d5e2e, #1a7a3f);
  border-radius: 1rem;
  border: 4px solid #ffc107;
  box-shadow: 0 0 30px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.3);
  position: relative;
}

/* ── Hand Zones ──────────────────────────────────────────────── */
.bj-hand-zone {
  margin-bottom: 1rem;
}

.bj-hand-label {
  font-family: var(--font-display, 'Fredoka One', cursive);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bj-score-badge {
  background: rgba(0,0,0,.4);
  color: #ffc107;
  padding: 0.15rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-family: monospace;
}

.bj-cards {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 110px;
  align-items: center;
}

/* ── Cards ───────────────────────────────────────────────────── */
.bj-card {
  width: 72px;
  height: 104px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
  transition: transform 0.4s ease;
  animation: bjDeal 0.35s ease-out;
  box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 1px rgba(255,255,255,.1);
}

.bj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 16px rgba(0,0,0,.6);
}

.bj-card.face-up {
  background: #fff;
  color: #222;
  border: 2px solid #ddd;
}

.bj-card.face-down {
  background: linear-gradient(135deg, #7b1fa2, #4a148c);
  border: 2px solid #9c27b0;
  color: transparent;
}

.bj-card.face-down::after {
  content: '🐾';
  position: absolute;
  font-size: 1.8rem;
  color: rgba(255,255,255,.3);
}

.bj-card.red { color: #c62828; }

.bj-card .card-corner {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.6rem;
  line-height: 1.2;
  text-align: center;
}

.bj-card .card-center {
  font-size: 2rem;
}

@keyframes bjDeal {
  from { transform: translateY(-40px) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Divider ─────────────────────────────────────────────────── */
.bj-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  margin: 1rem 0;
}

/* ── Controls ────────────────────────────────────────────────── */
.bj-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.bj-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  border: 2px solid rgba(255,255,255,.2);
  font-family: var(--font-display, 'Fredoka One', cursive);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.bj-btn-hit {
  background: #43a047;
  color: #fff;
}
.bj-btn-hit:hover:not(:disabled) { background: #2e7d32; }

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

.bj-btn-double {
  background: #ff9800;
  color: #000;
}
.bj-btn-double:hover:not(:disabled) { background: #ef6c00; }

.bj-btn-deal {
  background: #7b1fa2;
  color: #fff;
  padding: 0.7rem 2rem;
}
.bj-btn-deal:hover:not(:disabled) { background: #6a1b9a; }

/* ── Bet Area ────────────────────────────────────────────────── */
.bj-bet-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.bj-bet-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #ffc107;
  background: rgba(0,0,0,.4);
  color: #ffc107;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.1);
}

.bj-bet-btn.active {
  background: linear-gradient(135deg, #ffc107, #ffab00);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(255,193,7,.4);
}

.bj-bet-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255,193,7,.3);
}

/* ── Result ──────────────────────────────────────────────────── */
.bj-result {
  text-align: center;
  min-height: 2rem;
  font-family: var(--font-display, 'Fredoka One', cursive);
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

.bj-result.win   {
  color: #ffc107;
  text-shadow: 0 0 12px rgba(255,193,7,.5);
  animation: bjResultPop 0.4s ease;
}
.bj-result.lose  { color: #ef5350; }
.bj-result.push  { color: #90caf9; }

@keyframes bjResultPop {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Hidden Controls ─────────────────────────────────────────── */
.bj-controls--hidden { display: none; }

/* ── Win Animation ───────────────────────────────────────────── */
@keyframes bjWinGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.3); }
  50%      { box-shadow: 0 0 30px rgba(255,193,7,.4), inset 0 0 40px rgba(255,193,7,.1); }
}
.bj-table.winning { animation: bjWinGlow 0.5s ease 3; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 500px) {
  .bj-table { padding: 1rem; }
  .bj-card { width: 56px; height: 82px; font-size: 1.1rem; }
  .bj-card .card-center { font-size: 1.4rem; }
  .bj-card .card-corner { font-size: 0.5rem; }
  .bj-btn { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
}
