* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at center, #1a4d2e 0%, #0d2b1a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.table {
  width: 90%;
  max-width: 900px;
  background: #0f3d24;
  border: 12px solid #5a3d1a;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.3);
  padding: 24px;
  position: relative;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.header h1 {
  font-size: 2.2rem;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  line-height: 1;
}
.by-seb {
  font-size: 0.85rem;
  color: #aaa;
  font-style: italic;
  margin-top: 4px;
  letter-spacing: 1px;
}
.bankroll {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd700;
  background: rgba(0,0,0,0.3);
  padding: 8px 16px;
  border-radius: 8px;
}
.area {
  background: rgba(0,0,0,0.15);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  min-height: 160px;
}
.dealer-area { border: 2px solid rgba(255,77,77,0.3); }
.player-area { border: 2px solid rgba(77,121,255,0.3); }
.label {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #ffd700;
}
.score {
  position: absolute;
  right: 30px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.4);
  padding: 4px 12px;
  border-radius: 6px;
}
.dealer-area .score { top: 90px; }
.player-area .score { bottom: 110px; }
.area { position: relative; }
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 110px;
}
.card {
  width: 78px;
  height: 110px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #222;
  position: relative;
  transition: transform 0.2s;
  border: 1px solid #ccc;
}
.card.red { color: #c00; }
.card.hidden {
  background: linear-gradient(135deg, #3a5a8c 0%, #1a2a4a 100%);
  border: 2px solid #fff;
}
.card.hidden::after {
  content: '?';
  color: #fff;
  font-size: 2rem;
  opacity: 0.4;
}
.card .suit {
  font-size: 2rem;
  line-height: 1;
}
.message {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  min-height: 40px;
  margin: 12px 0;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.bet-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.chip {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px dashed #fff;
  background: #c00;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}
.chip:nth-child(2) { background: #00a; }
.chip:nth-child(3) { background: #0a0; }
.chip:nth-child(4) { background: #a0a; }
.chip:hover { transform: scale(1.1); box-shadow: 0 0 15px rgba(255,215,0,0.5); }
.chip.active { box-shadow: 0 0 0 4px #ffd700; }
.current-bet {
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: 12px;
}
.action-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.action-controls button {
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
#btn-deal { background: #ffd700; color: #222; }
#btn-deal:hover { background: #ffec8b; }
#btn-hit { background: #4d79ff; color: #fff; }
#btn-hit:hover { background: #6a9fff; }
#btn-stand { background: #ff4d4d; color: #fff; }
#btn-stand:hover { background: #ff7a7a; }
#btn-double { background: #00aa55; color: #fff; }
#btn-double:hover { background: #33cc77; }
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  body { padding: 8px; }
  .table { width: 100%; border-width: 6px; border-radius: 16px; padding: 12px; }
  .header { flex-direction: column; gap: 8px; margin-bottom: 12px; text-align: center; }
  .header h1 { font-size: 1.6rem; }
  .by-seb { font-size: 0.75rem; }
  .bankroll { font-size: 1rem; padding: 6px 12px; }
  .area { padding: 10px; min-height: 110px; }
  .card { width: 48px; height: 70px; font-size: 0.9rem; border-radius: 5px; }
  .card .suit { font-size: 1.2rem; }
  .score { font-size: 1rem; right: 16px; top: 8px; }
  .dealer-area .score { top: 50px; right: 16px; }
  .player-area .score { bottom: 80px; right: 16px; }
  .message { font-size: 1.1rem; margin: 8px 0; }
  .chip { width: 52px; height: 52px; font-size: 0.85rem; border-width: 3px; }
  .current-bet { font-size: 1rem; margin-left: 0; margin-top: 8px; width: 100%; text-align: center; }
  .bet-controls { gap: 6px; }
  .action-controls button { padding: 10px 18px; font-size: 1rem; }
  .controls { gap: 10px; }
}

@media (max-width: 400px) {
  .card { width: 40px; height: 58px; font-size: 0.75rem; }
  .card .suit { font-size: 1rem; }
  .action-controls button { padding: 8px 14px; font-size: 0.9rem; }
  .chip { width: 46px; height: 46px; font-size: 0.75rem; }
}
