/* BarutLive Blackjack — site renk paleti (--primary / --primary-accent) */
.bj-embed {
  --theme-primary: var(--primary-accent);
  --theme-secondary: var(--primary);
  --theme-dark: color-mix(in srgb, var(--primary) 55%, #000 45%);
  --theme-rgb: var(--primary-accent-rgb);
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(var(--primary-rgb), 0.18);
  --text-muted: rgba(160, 190, 220, 0.65);
  color: #e8f4ff;
  width: 100%;
  min-height: 420px;
  box-sizing: border-box;
}

.bj-embed * { box-sizing: border-box; }

.bj-coin-ico {
  display: inline-block;
  font-size: 0.95rem;
  vertical-align: middle;
  margin-left: 2px;
}

.bj-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
  min-height: 400px;
}

.bj-sidebar {
  width: 100%;
  flex: 0 0 auto;
}

.bj-table-col {
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  overflow: hidden;
}

.bj-controls-panel {
  --bj-control-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.6rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(var(--bg-dark-rgb), 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bj-row-between { display: flex; justify-content: space-between; align-items: flex-start; }
.bj-items-center { align-items: center; }
.bj-space-bottom { margin-bottom: 0.35rem; }
.bj-muted { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.bj-text-white { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.bj-primary { color: var(--theme-primary); }
.bj-bold { font-weight: 700; }

.bj-bet-group {
  display: flex;
  min-height: var(--bj-control-height);
  background: var(--panel-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bj-bet-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.bj-bet-input {
  width: 100%;
  background: transparent;
  min-height: var(--bj-control-height);
  padding: 0.65rem 2.2rem 0.65rem 0.75rem;
  outline: 0;
  color: #fff;
  border: 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
}

.bj-bet-icon {
  position: absolute;
  right: 0.65rem;
  pointer-events: none;
  opacity: 0.85;
}

.bj-bet-multiplier {
  background: rgba(255, 255, 255, 0.04);
  padding: 0 1rem;
  min-height: var(--bj-control-height);
  border: 0;
  border-left: 1px solid var(--panel-border);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: background 0.2s;
}

.bj-bet-multiplier:hover:not(:disabled) { background: rgba(var(--primary-rgb), 0.12); }
.bj-bet-multiplier:disabled { opacity: 0.45; cursor: not-allowed; }

.bj-current-bet-box {
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bj-btn-deal {
  width: 100%;
  min-height: var(--bj-control-height);
  padding: 0.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #021018;
  border: 0;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  background: var(--theme-btn-gradient);
  box-shadow: 0 6px 22px var(--theme-btn-shadow);
  transition: transform 0.15s, box-shadow 0.2s;
}

.bj-btn-deal:hover:not(:disabled) {
  color: #fff;
  box-shadow: 0 8px 28px rgba(var(--theme-rgb), 0.4);
}

.bj-action-group { display: flex; flex-direction: column; gap: 0.55rem; }
.bj-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.bj-action-btn {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-weight: 700;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.bj-action-btn-strong {
  background: rgba(var(--primary-rgb), 0.14);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
}

.bj-action-btn-strong:hover:not(:disabled) { background: rgba(var(--primary-rgb), 0.24); }
.bj-action-btn-soft {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bj-action-btn-soft:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.bj-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.bj-status-box {
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bj-status-text { text-align: center; }
.bj-status-fixed-text {
  color: rgba(200, 220, 245, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

.bj-embed .hidden { display: none !important; }

/* Masa */
.bj-embed .game-area {
  --bj-hands-gap: 48px;
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  flex: 1 1 auto;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--bj-hands-gap);
  padding: 16px 10px;
  background: rgba(var(--primary-rgb), 0.08);
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  overflow: hidden;
}

.bj-embed .game-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  text-align: center;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s;
}

.bj-embed .game-area.is-idle .game-logo { opacity: 0.88; }
.bj-embed .game-area:not(.is-idle) .game-logo { opacity: 0; }

.bj-embed .game-logo-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--theme-primary);
  text-shadow: 0 0 20px rgba(var(--theme-rgb), 0.45);
}

.bj-embed .game-logo-subtitle {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-secondary);
}

.bj-embed .hand-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.bj-embed .hand-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bj-embed .game-area.is-idle .hand-header {
  visibility: hidden;
  opacity: 0;
}

.bj-embed .hand-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(160, 190, 220, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.bj-embed .hand-value {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #021018;
  background: var(--theme-btn-gradient);
  border-radius: 999px;
}

.bj-embed .cards-container {
  position: relative;
  height: var(--bj-cards-container-h, 112px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bj-embed .card-position {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bj-embed .card-wrapper {
  width: var(--bj-card-w, 74px);
  height: var(--bj-card-h, 108px);
  perspective: 800px;
  cursor: default;
  background: transparent;
  border: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.bj-embed .card-horizontal {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.bj-embed .card-content {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--transition-time, 600ms) cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
}

.bj-embed .card-wrapper.face-down .card-content { transform: rotateY(180deg); }

.bj-embed .card-face,
.bj-embed .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
}

.bj-embed .card-face {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.bj-embed .card-face.red-suit { color: #dc2626; }
.bj-embed .card-face.black-suit { color: #1e293b; }

.bj-embed .card-back {
  transform: rotateY(180deg);
  background: #0a1528;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  padding: 2px;
}

.bj-embed .card-back-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  display: block;
}

.bj-embed .card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.bj-embed .card-corner .rank { font-size: 15px; font-weight: 800; }
.bj-embed .card-corner .mini-suit { width: 13px; height: 13px; margin-top: 1px; }
.bj-embed .card-corner .mini-suit svg { width: 100%; height: 100%; }
.bj-embed .card-corner.top-left { align-self: flex-start; }
.bj-embed .card-corner.bottom-right {
  align-self: flex-end;
  transform: rotate(180deg);
}

.bj-embed .card-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.bj-embed .card-suit-icon-large { width: 22px; height: 22px; }
.bj-embed .card-suit-icon-large svg { width: 100%; height: 100%; }

@keyframes bj-dealCardIn {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + 200px), calc(-50% - 260px)) scale(0.6) rotate(15deg);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, calc(-50% + 5px)) scale(1.03) rotate(-1deg);
  }
  80% {
    opacity: 1;
    transform: translate(calc(-50% + var(--card-offset, 0px)), calc(-50% - 2px)) scale(1.01) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--card-offset, 0px)), -50%) scale(1) rotate(0deg);
  }
}

.bj-embed .card-position.dealing {
  opacity: 0;
  animation: bj-dealCardIn 680ms cubic-bezier(0.22, 0.68, 0.36, 1) forwards;
}

@keyframes bj-hitCardIn {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + 120px), calc(-50% - 160px)) scale(0.7) rotate(10deg);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, calc(-50% + 3px)) scale(1.02) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--card-offset, 0px)), -50%) scale(1) rotate(0deg);
  }
}

.bj-embed .card-position.hit-deal {
  opacity: 0;
  animation: bj-hitCardIn 550ms cubic-bezier(0.22, 0.68, 0.36, 1) forwards;
}

@keyframes bj-flipReveal {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

.bj-embed .card-wrapper.flip-reveal .card-content {
  animation: bj-flipReveal 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.bj-embed .result-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  padding: 14px 28px;
  border-radius: 12px;
  background: rgba(0, 8, 18, 0.92);
  border: 2px solid rgba(var(--theme-rgb), 0.45);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bj-embed .result-main { display: block; }
.bj-embed .result-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
}

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

.bj-embed .result-overlay.win { border-color: #22c55e; color: #86efac; }
.bj-embed .result-overlay.lose { border-color: #ef4444; color: #fca5a5; }
.bj-embed .result-overlay.push { border-color: #eab308; color: #fde047; }
.bj-embed .result-overlay.blackjack {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
  font-size: 1.65rem;
}

@keyframes bj-balancePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); color: var(--theme-primary); }
  100% { transform: scale(1); }
}

.bj-embed .balance-changed { animation: bj-balancePulse 0.45s ease; }

@media (min-width: 768px) {
  .bj-content-wrap {
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
    padding: 0.65rem;
    min-height: 480px;
  }
  .bj-sidebar { width: 34%; max-width: 360px; }
  .bj-table-col { width: 66%; min-height: 400px; }
}

@media (max-width: 767px) {
  .bj-embed .game-area {
    --bj-hands-gap: 22px;
    min-height: 240px;
    padding: 10px 6px;
  }
  .bj-embed .game-logo { transform: translate(-50%, -50%) scale(0.72); }
  .bj-embed .result-overlay { font-size: 1.1rem; padding: 12px 20px; }
}