/* ═══════════════════════════════════════════════════════
   BLACKJACK — kompletny redesign
   ═══════════════════════════════════════════════════════ */

:root {
  --bj-green:   #1a6b3a;
  --bj-felt:    #0d4a26;
  --bj-border:  #2a8a50;
  --bj-gold:    #ffd700;
  --bj-win:     #4ade80;
  --bj-lose:    #f87171;
  --bj-push:    #94a3b8;
}

.bj-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* BET PANEL (left sidebar) */
.bj-bet-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.bj-bet-panel .bpanel-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.bj-bet-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
}
.bj-bet-input-row input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: #e2e8f0; font-size: 0.95rem; font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
}
.bj-bet-input-row input::-webkit-outer-spin-button,
.bj-bet-input-row input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bj-hd-btns {
  display: flex;
  gap: 4px;
}
.bj-hd-btns button, .bj-chip-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8; border-radius: 8px;
  padding: 4px 10px; cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 0.8rem;
  transition: all 0.12s;
}
.bj-hd-btns button:hover, .bj-chip-btn:hover {
  background: rgba(255,255,255,0.13); color: #e2e8f0;
  border-color: #4b5563;
}
.bj-chips-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.bj-chip-btn {
  text-align: center;
  padding: 5px 4px; font-size: 0.77rem;
}
.bj-deal-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; border: none; border-radius: 11px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.07em; cursor: pointer;
  transition: all 0.15s;
}
.bj-deal-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(22,163,74,0.45); filter: brightness(1.08); }
.bj-deal-btn:active:not(:disabled) { transform: translateY(0); }
.bj-deal-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.bj-fair-note {
  font-size: 0.7rem; color: #475569;
  display: flex; align-items: center; gap: 5px;
}
.bj-fair-note em {
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.2);
  color: #4ade80; padding: 1px 7px; border-radius: 20px;
  font-style: normal; font-weight: 700; font-size: 0.66rem;
}

/* TABLE */
.bj-table {
  background: radial-gradient(ellipse at 50% 30%, #1e7a42 0%, #0d4a26 55%, #083320 100%);
  border: 3px solid var(--bj-border);
  border-radius: 24px;
  padding: 32px 28px 28px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 0 80px rgba(42,138,80,0.15), inset 0 0 120px rgba(0,0,0,0.35);
  gap: 20px;
}
.bj-table::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 21px;
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 3px,
    rgba(255,255,255,0.012) 3px, rgba(255,255,255,0.012) 6px
  );
  pointer-events: none;
}
.bj-table::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70%; height: 55%;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}
.bj-zone {
  width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 10px; position: relative; z-index: 1;
}
.bj-zone-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  background: rgba(0,0,0,0.3); padding: 2px 12px; border-radius: 20px;
}
.bj-zone-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem; font-weight: 800; color: #fff;
  background: rgba(0,0,0,0.5); padding: 3px 16px; border-radius: 20px;
  min-width: 50px; text-align: center; transition: all 0.2s;
}
.bj-zone-value.busted { color: var(--bj-lose); background: rgba(248,113,113,0.15); }
.bj-zone-value.bj     { color: var(--bj-gold); background: rgba(255,215,0,0.15); }

/* CARDS */
.bj-cards {
  display: flex; gap: 10px;
  justify-content: center; flex-wrap: wrap;
  position: relative; min-height: 110px;
}
.bj-card {
  width: 72px; height: 105px;
  background: #fff; border-radius: 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.5rem;
  box-shadow: 0 6px 22px rgba(0,0,0,0.65), 0 1px 0 rgba(255,255,255,0.9) inset;
  position: relative; flex-shrink: 0;
  opacity: 0;
  transform: translateY(-30px) rotate(-6deg) scale(0.82);
  transition: none;
}
.bj-card.dealt {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
  transition: opacity 0.2s ease-out, transform 0.22s cubic-bezier(0.34,1.3,0.64,1);
}
.bj-card.flip-in { animation: cardFlip 0.32s ease-out forwards; }
.bj-card.red   { color: #dc2626; }
.bj-card.black { color: #1e293b; }
.bj-card.hidden {
  background: linear-gradient(140deg, #1e3a5f 0%, #1d4ed8 50%, #1e3a5f 100%);
  color: transparent;
}
.bj-card.hidden::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 4px;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 5px,
    rgba(255,255,255,0.04) 5px, rgba(255,255,255,0.04) 10px
  );
}
.pip-tl {
  position: absolute; top: 6px; left: 7px;
  font-size: 0.88rem; font-weight: 900; line-height: 1.1; text-align: left;
}
.pip-tl .pip-suit { font-size: 0.6rem; display: block; }
.pip-br {
  position: absolute; bottom: 6px; right: 7px;
  font-size: 0.88rem; font-weight: 900; line-height: 1.1; text-align: right;
  transform: rotate(180deg);
}
.pip-br .pip-suit { font-size: 0.6rem; display: block; }
.center-rank { font-size: 1.35rem; font-weight: 900; z-index: 1; }

@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.88); opacity: 0.2; }
  55%  { transform: rotateY(-8deg) scale(1.06); opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

/* HANDS ROW */
.bj-hands-row {
  display: flex; gap: 22px;
  justify-content: center; align-items: flex-start; flex-wrap: wrap;
}
.bj-hand-group { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-hand-label { font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.38); letter-spacing: 0.1em; text-transform: uppercase; }
.bj-hand-active .bj-card.dealt { box-shadow: 0 0 0 2.5px var(--bj-gold), 0 6px 22px rgba(0,0,0,0.65); }
.bj-hand-bust .bj-card { filter: brightness(0.5); }
.bj-hand-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.88rem; font-weight: 800;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.5); padding: 2px 12px; border-radius: 20px;
  transition: all 0.2s;
}
.bj-hand-value.bust { color: var(--bj-lose); }
.bj-hand-value.bj   { color: var(--bj-gold); }

/* BET DISPLAY ON TABLE */
.bj-bet-display {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Rajdhani', sans-serif; font-size: 1.05rem; font-weight: 800;
  color: var(--bj-gold); background: rgba(0,0,0,0.42);
  padding: 4px 18px; border-radius: 20px; min-height: 30px; letter-spacing: 0.04em;
}
@keyframes chipPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
.bj-bet-display.anim { animation: chipPop 0.28s ease-out; }

/* RESULT BANNER */
.bj-result-banner {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-4deg);
  background: rgba(4,8,14,0.97);
  border: 2px solid var(--bj-border); border-radius: 18px;
  padding: 22px 46px; text-align: center;
  z-index: 20; transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; white-space: nowrap;
}
.bj-result-banner.show { transform: translate(-50%,-50%) scale(1) rotate(0); }
.bj-res-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.3rem; font-weight: 900; letter-spacing: 0.08em; display: block;
}
.bj-res-label.win  { color: var(--bj-win);  text-shadow: 0 0 30px rgba(74,222,128,0.7); }
.bj-res-label.lose { color: var(--bj-lose); text-shadow: 0 0 30px rgba(248,113,113,0.7); }
.bj-res-label.push { color: var(--bj-push); }
.bj-res-label.bj   { color: var(--bj-gold); text-shadow: 0 0 30px rgba(255,215,0,0.8); }
.bj-res-amount {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: rgba(255,255,255,0.55);
  margin-top: 6px; display: block;
}

/* ACTION BUTTONS */
.bj-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.bj-action-btn {
  padding: 14px 6px; border-radius: 13px; border: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em;
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative; overflow: hidden;
}
.bj-action-btn .btn-icon { font-size: 1.4rem; line-height: 1; }
.bj-action-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 55%);
  pointer-events: none;
}
.bj-action-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.bj-action-btn:not(:disabled):hover { transform: translateY(-3px); filter: brightness(1.18); }
.bj-action-btn:not(:disabled):active { transform: translateY(-1px); }
.bj-btn-hit    { background: linear-gradient(150deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 4px 18px rgba(37,99,235,0.4); }
.bj-btn-stand  { background: linear-gradient(150deg, #ef4444, #b91c1c); color: #fff; box-shadow: 0 4px 18px rgba(220,38,38,0.4); }
.bj-btn-double { background: linear-gradient(150deg, #f59e0b, #b45309); color: #fff; box-shadow: 0 4px 18px rgba(217,119,6,0.4); }
.bj-btn-split  { background: linear-gradient(150deg, #8b5cf6, #6d28d9); color: #fff; box-shadow: 0 4px 18px rgba(124,58,237,0.4); }
.bj-btn-insure { background: linear-gradient(150deg, #22d3ee, #0891b2); color: #fff; box-shadow: 0 4px 18px rgba(8,145,178,0.4); }
.bj-btn-no-ins { background: linear-gradient(150deg, #64748b, #334155); color: #fff; }

/* INSURANCE BANNER */
.bj-insurance-banner {
  background: rgba(8,145,178,0.1); border: 1px solid rgba(8,145,178,0.35);
  border-radius: 14px; padding: 16px 20px;
  text-align: center; display: none;
}
.bj-insurance-banner.show { display: block; animation: slideDown 0.22s ease-out; }
.bj-insurance-banner p { color: #7dd3fc; font-size: 0.9rem; margin: 0 0 12px; font-weight: 600; }
.bj-ins-btns { display: flex; gap: 10px; justify-content: center; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* INFO BAR below table */
.bj-info-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.bj-info-col h4 {
  font-size: 0.72rem; font-weight: 700; color: #475569;
  letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 8px;
}
.bj-info-col .ir {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: #475569; padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.bj-info-col .ir strong { color: #94a3b8; }
.val-gold  { color: var(--bj-gold)  !important; font-weight: 700; }
.val-green { color: var(--bj-win)   !important; font-weight: 700; }
.val-red   { color: var(--bj-lose)  !important; font-weight: 700; }

/* HISTORY */
.bj-history { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.bj-history-header { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.bj-history-title { font-weight: 700; font-size: 0.88rem; }
.bj-history-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.bj-history-table th { padding: 7px 14px; text-align: left; color: #475569; font-weight: 600; font-size: 0.72rem; background: rgba(255,255,255,0.02); letter-spacing: 0.06em; text-transform: uppercase; }
.bj-history-table td { padding: 7px 14px; border-top: 1px solid rgba(255,255,255,0.04); }
.bj-history-table tr:hover td { background: rgba(255,255,255,0.02); }
.h-win  { color: var(--bj-win);  font-weight: 700; }
.h-lose { color: var(--bj-lose); font-weight: 700; }
.h-push { color: var(--bj-push); }

/* TOAST */
.bj-toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(8,12,20,0.97); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 26px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem;
  z-index: 9999; opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.3,0.64,1);
  white-space: nowrap; pointer-events: none; letter-spacing: 0.03em;
}
.bj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.bj-toast.win  { border-color: var(--bj-win);  color: var(--bj-win); }
.bj-toast.lose { border-color: var(--bj-lose); color: var(--bj-lose); }
.bj-toast.info { border-color: #3b82f6; color: #93c5fd; }

@media (max-width: 700px) {
  .bj-actions { grid-template-columns: repeat(2,1fr); }
  .bj-card { width: 60px; height: 88px; }
  .bj-info-bar { grid-template-columns: 1fr; }
}
