/* Blackjack Pro CSS */
:root {
  --table-green: radial-gradient(circle at center, #1b6232 0%, #0e361b 100%);
  --panel-bg: rgba(10, 20, 15, 0.95);
  --ui-font: 'Montserrat', sans-serif;
  --card-font: 'Arbutus Slab', serif;
  --accent-gold: #f39c12;
  --win-green: #2ecc71;
  --lose-red: #e74c3c;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--table-green);
  font-family: var(--ui-font);
  color: white;
  overflow: hidden;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

/* TOP HEADER */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

#bankroll-container {
  display: flex;
  gap: 20px;
}

.stat-box {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-box.bet-box {
  background: rgba(243, 156, 18, 0.15);
  border-color: rgba(243, 156, 18, 0.4);
}

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #bbb;
}

.value {
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.bet-box .value {
  color: var(--accent-gold);
}

/* GAME TABLE */
#table {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.table-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.border-line {
  width: 60%;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
}

.score {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.4);
  padding: 6px 20px;
  border-radius: 20px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.score span {
  font-size: 22px;
  font-weight: 800;
  margin-left: 8px;
}

.cards-wrapper {
  position: relative;
  min-height: 180px;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* CARDS */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px; /* Spaces cards evenly instead of floating left */
}

/* Position Deck off to the right slightly */
#deck {
  position: absolute;
  right: -130px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 150px;
  border-radius: 8px;
  padding: 2px;
  background-color: transparent;
  box-shadow: 2px 2px 15px rgba(0,0,0,0.5);
  z-index: 10;
}

.back {
  background: #205081;
  background:
    linear-gradient(115deg, transparent 75%, rgba(255,255,255,.8) 75%) 0 0,
    linear-gradient(245deg, transparent 75%, rgba(255,255,255,.8) 75%) 0 0,
    linear-gradient(115deg, transparent 75%, rgba(255,255,255,.8) 75%) 7px -15px,
    linear-gradient(245deg, transparent 75%, rgba(255,255,255,.8) 75%) 7px -15px,
    #205081;
  background-size: 15px 30px;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: 2px solid white;
}

.card {
  font-family: var(--card-font);
  position: relative;
  width: 100px;
  height: 150px;
  border-radius: 8px;
  background-color: #fff;
  color: #333;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05), 2px 4px 15px rgba(0,0,0,0.3);
  padding: 8px;
  box-sizing: border-box;
  transform-style: preserve-3d;
  animation: slidein 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  border: 1px solid rgba(0,0,0,0.1);
}

.card .top.rank {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 18px;
  font-weight: bold;
}

.card .bottom.rank {
  position: absolute;
  bottom: 5px;
  right: 8px;
  font-size: 18px;
  font-weight: bold;
  transform: rotate(180deg);
}

.card .suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
}

.card-hidden {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  animation: flip-deal 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.diamonds, .hearts { color: #e74c3c; }
.spades, .clubs { color: #1a1a1a; }

.blur-vision {
  filter: blur(5px) sepia(0.3) saturate(0.8) !important;
  transition: filter 2s ease-in-out;
}

.dead-vision {
  filter: grayscale(100%) brightness(0.4) contrast(1.5) !important;
  transition: filter 3s ease-in-out;
}


@keyframes slidein {
  from { transform: translateY(-100px) scale(0.8) rotateY(-20deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotateY(0deg); opacity: 1; }
}

@keyframes flip-deal {
  from { transform: translateY(-100px) scale(0.8) rotateY(180deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotateY(0deg); opacity: 1; }
}

/* BOTTOM PANEL */
#panel {
  background: var(--panel-bg);
  padding: 25px;
  text-align: center;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#status {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(255,255,255,0.2);
  text-transform: uppercase;
  transition: all 0.3s;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn {
  font-family: var(--ui-font);
  border: none;
  border-radius: 40px;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 6px 0 rgba(0,0,0,0.2);
  text-transform: uppercase;
  outline: none;
}

.btn:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.btn:disabled {
  background-color: #555;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
  transform: translateY(6px);
}

.blue { background-color: #3498db; }
.blue:hover:not(:disabled) { background-color: #2980b9; }

.green { background-color: var(--win-green); }
.green:hover:not(:disabled) { background-color: #27ae60; }

.red { background-color: var(--lose-red); }
.red:hover:not(:disabled) { background-color: #c0392b; }

.yellow { background-color: var(--accent-gold); color: #fff; }
.yellow:hover:not(:disabled) { background-color: #d68910; }

.purple { background-color: #8e44ad; }
.purple:hover:not(:disabled) { background-color: #9b59b6; }

/* BETTING CONTROLS */
#betting-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 5px;
}

#betting-controls span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #aaa;
}

#bet-decrease, #bet-increase {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.3);
  font-size: 24px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  outline: none;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

#bet-decrease { background-color: #e74c3c; }
#bet-increase { background-color: #2ecc71; }

#bet-decrease:active:not(:disabled),
#bet-increase:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(0,0,0,0.3);
}

#bet-decrease:disabled, #bet-increase:disabled {
  filter: grayscale(1);
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: translateY(4px);
}

/* BLACK MARKET SIDEBAR */
#black-market {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid #9b59b6;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  box-shadow: 0 0 25px rgba(155, 89, 182, 0.4);
  z-index: 100;
  max-width: 180px;
  text-align: center;
}

#black-market h3 {
  color: #9b59b6;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

#black-market p {
  color: #aaa;
  font-family: var(--ui-font);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 5px;
}

#black-market #bailout {
  width: 100%;
  padding: 12px 10px;
  font-size: 13px;
  margin: 0;
}
