/* ================================================
   blackjack.css – Casino Blackjack – Modern v2
   ================================================ */

body {
  background: #060b14;
  margin: 0; padding: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
}

/* ── Casino kamer ── */
.casino-room {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 52px 8px 8px;
  gap: 6px;
  overflow: hidden;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0,200,120,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(100,50,200,0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0)         0%, rgba(0,0,0,0.4) 100%),
    repeating-linear-gradient(0deg,   transparent, transparent 59px, rgba(255,255,255,0.015) 60px),
    repeating-linear-gradient(90deg,  transparent, transparent 59px, rgba(255,255,255,0.015) 60px),
    #060b14;
}

/* Hoek decoraties */
.room-deco {
  position: fixed;
  top: 52px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.room-deco-left  { left: 12px; align-items: flex-start; }
.room-deco-right { right: 12px; align-items: flex-end; }

.deck-label {
  font-size: 0.52rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1.5;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.card-deck {
  width: 42px; height: 60px;
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4), 4px 4px 0 rgba(0,0,0,0.25);
}
.red-back  { background: linear-gradient(145deg, #c0392b, #7b241c); border: 1.5px solid rgba(231,76,60,0.6); }
.gold-back { background: linear-gradient(145deg, #b8860b, #5c4000); border: 1.5px solid rgba(212,160,23,0.6); }
.card-deck::after {
  content: '';
  position: absolute; inset: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 8px);
}

.chips-deco {
  display: flex; gap: 3px; flex-wrap: wrap;
  max-width: 80px; justify-content: flex-end; margin-top: 4px;
}
.chip-d {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.38rem;
  border: 2px dashed rgba(255,255,255,0.25);
  box-shadow: 0 2px 6px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.15);
  color: white;
}
.c500 { background: radial-gradient(circle at 35% 30%, #e879f9, #a21caf); }
.c100 { background: radial-gradient(circle at 35% 30%, #94a3b8, #334155); }
.c50  { background: radial-gradient(circle at 35% 30%, #e2e8f0, #94a3b8); color:#111; }
.c25  { background: radial-gradient(circle at 35% 30%, #4ade80, #15803d); }
.c10  { background: radial-gradient(circle at 35% 30%, #60a5fa, #1d4ed8); }
.c5   { background: radial-gradient(circle at 35% 30%, #f87171, #b91c1c); }

/* Kaarten resterende teller */
.remaining-cards-bar {
  position: fixed;
  top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.66rem; color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 4px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Speeltafel ── */
.table-oval {
  position: relative;
  width: min(96vw, 960px);
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(ellipse at 50% 0%,   rgba(0,180,80,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(0,80,30,0.3)   0%, transparent 55%),
    linear-gradient(180deg, #0d3320 0%, #081c10 100%);
  border-radius: 20px;
  border: 1px solid rgba(0,255,120,0.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 60px rgba(0,0,0,0.35),
    0 0 0 1px rgba(0,200,80,0.08),
    0 0 30px rgba(0,180,80,0.12),
    0 12px 50px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 14px;
  box-sizing: border-box;
  overflow: visible;
  z-index: 20;
}

.felt-overlay {
  position: absolute; inset: 0;
  border-radius: 18px;
  background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3L3 1M0 1L1 0M3 4L4 3' stroke='%23ffffff' stroke-width='0.3' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}
.table-oval::before {
  content: '';
  position: absolute; inset: 1px;
  border-radius: 19px;
  border: 1px solid rgba(0,255,120,0.06);
  pointer-events: none; z-index: 1;
}

/* ── Dealer sectie ── */
.dealer-section {
  position: relative; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.dealer-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem; letter-spacing: 4px;
  color: rgba(0,255,140,0.55);
  text-shadow: 0 0 8px rgba(0,255,140,0.3);
  margin-bottom: 2px;
}
.dealer-score-wrap {
  height: 28px; display: flex; align-items: center; justify-content: center;
}
.dealer-cards-row {
  display: flex; justify-content: center; min-height: 80px;
  align-items: flex-end; gap: 0;
}
.dealer-cards-row .card       { margin-left: -22px; }
.dealer-cards-row .card:first-child { margin-left: 0; }

/* ── Casino regels ── */
.casino-rules {
  position: relative; z-index: 5;
  text-align: center; padding: 2px 16px; flex-shrink: 0;
}
.rule-main {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.55rem, 1.3vw, 0.85rem);
  font-weight: 700;
  color: rgba(0,255,140,0.35);
  letter-spacing: 2px; line-height: 1.6;
}
.rule-sub {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.4rem, 0.8vw, 0.58rem);
  color: rgba(255,255,255,0.2);
  letter-spacing: 1px;
}

/* ── Status ── */
.status-message {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.65rem, 1.5vw, 0.9rem);
  font-weight: 700; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 5;
  padding: 4px 16px; flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.07);
}

/* ── Spelers sectie ── */
.players-section {
  position: relative; z-index: 5;
  display: grid; gap: 8px; width: 100%; align-items: end; flex-shrink: 0;
}
.players-section.count-1 { grid-template-columns: 1fr;            max-width: 240px; margin: 0 auto; }
.players-section.count-2 { grid-template-columns: 1fr 1.4fr;     max-width: 480px; margin: 0 auto; }
.players-section.count-3 { grid-template-columns: 1fr 1.4fr 1fr; max-width: 640px; margin: 0 auto; }
.players-section.count-4 { grid-template-columns: 1fr 1.2fr 1.2fr 1fr; }

/* menselijke speler altijd in het midden */
.players-section.count-2 .player-box.human { order: 2; }
.players-section.count-2 #pbox-1           { order: 1; }
.players-section.count-3 .player-box.human { order: 2; }
.players-section.count-3 #pbox-1           { order: 1; }
.players-section.count-3 #pbox-2           { order: 3; }
.players-section.count-4 .player-box.human { order: 2; }

/* ── Speler box ── */
.player-box {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 8px 6px;
  min-height: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  position: relative; transition: all 0.3s ease;
  background: rgba(255,255,255,0.03);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.player-box.human {
  border-color: rgba(74,222,128,0.2);
  background: rgba(0,255,120,0.04);
}
.player-box.active {
  border-color: rgba(255,215,0,0.5) !important;
  box-shadow: 0 0 0 1px rgba(255,215,0,0.2), 0 0 20px rgba(255,215,0,0.15) !important;
  background: rgba(255,215,0,0.06) !important;
}
.player-box.human.active {
  border-color: rgba(74,222,128,0.5) !important;
  box-shadow: 0 0 0 1px rgba(74,222,128,0.2), 0 0 20px rgba(74,222,128,0.15) !important;
  background: rgba(74,222,128,0.06) !important;
}
.player-box.bust   { border-color: rgba(239,68,68,0.3) !important; opacity: 0.75; }
.player-box.winner {
  border-color: rgba(255,215,0,0.5) !important;
  box-shadow: 0 0 0 1px rgba(255,215,0,0.3), 0 0 30px rgba(255,215,0,0.2) !important;
  animation: winPulse 0.9s ease 3;
}
.player-box.loser  { opacity: 0.35; filter: grayscale(0.4); }
.player-box.push-state { border-color: rgba(167,139,250,0.3) !important; }

@keyframes winPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,215,0,0.3), 0 0 10px rgba(255,215,0,0.1); }
  50%      { box-shadow: 0 0 0 2px rgba(255,215,0,0.6), 0 0 40px rgba(255,215,0,0.35); }
}

.player-header {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 4px; width: 100%; justify-content: center;
}
.player-name  { font-weight: 700; font-size: 0.66rem; color: rgba(255,255,255,0.8); }
.bet-label    { font-size: 0.56rem; color: rgba(255,215,0,0.6); margin-top: 2px; }
.result-amount {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem; font-weight: 900;
  animation: resultPop 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes resultPop {
  0%   { transform: scale(0.4) translateY(8px); opacity: 0; }
  100% { transform: scale(1)   translateY(0);   opacity: 1; }
}

/* ── Score badge ── */
.score-badge {
  background: rgba(255,255,255,0.1);
  color: white;
  font-weight: 900; font-size: 0.85rem;
  padding: 2px 10px; border-radius: 20px;
  font-family: 'Orbitron', monospace;
  border: 1px solid rgba(255,255,255,0.15);
  min-width: 34px; text-align: center;
  display: inline-block; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.score-badge:empty { visibility: hidden; }
.score-badge.bust  { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.score-badge.bj    { background: rgba(255,215,0,0.2);  border-color: rgba(255,215,0,0.5);  color: #FFD700; }

/* ── Kaarten rij ── */
.cards-row {
  display: flex; justify-content: center;
  min-height: 70px; align-items: flex-end; position: relative;
}
.cards-row .card:not(:first-child) { margin-left: -20px; }
.cards-row .card:nth-child(2) { z-index: 2; }
.cards-row .card:nth-child(3) { z-index: 3; }
.cards-row .card:nth-child(4) { z-index: 4; }
.cards-row .card:nth-child(5) { z-index: 5; }

.cards-row.big { min-height: 96px; }
.cards-row.big .card:not(:first-child) { margin-left: -30px; }

/* ── Kaart element ── */
.card {
  position: relative; z-index: 1;
  display: inline-block;
  flex-shrink: 0;
  animation: cardDeal 0.35s cubic-bezier(0.34,1.56,0.64,1);
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.08) inset;
  cursor: default; -webkit-user-select: none; user-select: none;
}
.card img {
  display: block;
  width:  46px; height: 68px;
  border-radius: 6px;
}
.cards-row.big .card img,
.card.big img {
  width:  64px; height: 94px;
  border-radius: 7px;
}

.hidden-card img { opacity: 0.9; filter: brightness(0.85); }

@keyframes cardDeal {
  0%   { transform: translateY(-50px) scale(0.6) rotate(-12deg); opacity: 0; }
  100% { transform: translateY(0)     scale(1)   rotate(0);       opacity: 1; }
}
.flipping { animation: cardFlip 0.3s ease-out; }
@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: rotateY(0deg)  scale(1);   opacity: 1; }
}

/* ── Actie paneel ── */
.actions-panel {
  position: relative; z-index: 20;
  width: min(96vw, 960px);
  padding: 10px 16px 14px;
  background: rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
}

.bet-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.bet-info { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.bet-display {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem; color: var(--gold);
}
.bet-potential {
  font-size: 0.6rem; color: #4ade80;
  font-family: 'Orbitron', monospace; min-height: 14px;
}
.bet-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.deal-row  { display: flex; justify-content: center; }

/* Chips */
.chip {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.68rem;
  cursor: pointer; transition: all 0.2s ease;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.3);
  -webkit-user-select: none;
  user-select: none;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.2);
  position: relative;
}
.chip::after {
  content: '';
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.2);
}
.chip:hover  { transform: scale(1.22) translateY(-5px); filter: brightness(1.15); }
.chip:active { transform: scale(0.9); }
.chip:disabled { opacity: 0.25; cursor: not-allowed; transform: none !important; filter: none; }

.chip-5   { background: radial-gradient(circle at 35% 28%, #fca5a5, #b91c1c); border-color: rgba(252,165,165,0.5); color:white; }
.chip-10  { background: radial-gradient(circle at 35% 28%, #93c5fd, #1d4ed8); border-color: rgba(147,197,253,0.5); color:white; }
.chip-25  { background: radial-gradient(circle at 35% 28%, #6ee7b7, #059669); border-color: rgba(110,231,183,0.5); color:white; }
.chip-50  { background: radial-gradient(circle at 35% 28%, #d8b4fe, #7c3aed); border-color: rgba(216,180,254,0.5); color:white; }
.chip-100 { background: radial-gradient(circle at 35% 28%, #fde68a, #b45309); border-color: rgba(253,230,138,0.5); color:#1a0800; }

.chip-util {
  height: 38px; padding: 0 14px; border-radius: 20px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.7rem; cursor: pointer; transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}
.chip-util:hover  { background: rgba(255,255,255,0.12); color: white; }
.chip-util:disabled { opacity: 0.25; cursor: not-allowed; }
.chip-util.gold   { color: #ffd700; border-color: rgba(255,215,0,0.25); }
.chip-util.gold:hover { background: rgba(255,215,0,0.12); }

.play-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.play-buttons .btn { flex: 1; min-width: 80px; text-align: center; justify-content: center; font-size: 0.85rem; }

.key-hint {
  text-align: center; font-size: 0.58rem;
  color: rgba(255,255,255,0.25); margin: 0;
}

/* ── Spelersselectie modal ── */
.select-modal {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}
.select-card {
  max-width: 400px; width: 92%;
  padding: 36px 28px; text-align: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 0 0 1px rgba(0,255,120,0.1),
    0 0 40px rgba(0,200,80,0.08),
    0 24px 60px rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.select-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem; font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #4ade80, #FFD700);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.bot-buttons {
  display: flex; justify-content: center; gap: 12px; margin-bottom: 16px;
}
.bot-btn {
  width: 84px; height: 68px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: white; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.22s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.bot-btn:hover {
  border-color: rgba(74,222,128,0.4);
  background: rgba(74,222,128,0.1);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(74,222,128,0.2);
}

/* Terug knop */
.back-btn {
  position: fixed; top: 12px; left: 8px;
  z-index: 1010; font-size: 0.78rem; opacity: 0.55;
}
.back-btn:hover { opacity: 1; }

/* ── Responsief ── */
@media (max-width: 680px) {
  .casino-room     { padding: 50px 4px 4px; }
  .table-oval      { border-radius: 12px; padding: 12px 8px 10px; }
  .card img        { width: 36px; height: 54px; }
  .cards-row.big .card img { width: 50px; height: 74px; }
  .room-deco-left  { left: 4px; }
  .room-deco-right { right: 4px; }
  .chip            { width: 38px; height: 38px; font-size: 0.6rem; }
  .rule-main       { font-size: 0.5rem; }
  .rule-sub        { display: none; }
  .chips-deco      { display: none; }
  .deck-label      { display: none; }
}
@media (max-height: 700px) {
  .casino-rules { display: none; }
  .table-oval   { padding: 10px 16px 10px; }
}

/* ── Initieel verborgen elementen (via JS getoond) ── */
#casino-room { display: none; }
#split-btn   { display: none; }

/* ── Select modal tekst ── */
.select-modal-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
}
.select-modal-subtitle {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.select-modal-rules {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-top: 16px;
}
.select-modal-back {
  margin-top: 16px;
}

/* Uitbetaling kleuren */
.payout-win   { color: #4ade80; }
.payout-bj    { color: #FFD700; }
.payout-lose  { color: #f87171; }
.payout-push  { color: #a78bfa; }

/* Resterende kaarten afbeelding */
.remaining-cards-img { height: 22px; }
