@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --felt: #0d4a2e;
  --felt-dark: #083222;
  --felt-light: #156b42;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --cream: #f5f0e1;
  --red: #c0392b;
  --blue: #2980b9;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
  color: var(--cream);
  min-height: 100vh;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

header {
  text-align: center;
  padding: 12px 0 20px;
}

header h1 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

header .subtitle {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 4px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  background: linear-gradient(160deg, var(--felt-light) 0%, var(--felt) 40%, var(--felt-dark) 100%);
  border-radius: 200px / 60px;
  border: 6px solid #5c3d1e;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 24px 20px 32px;
  min-height: 520px;
  position: relative;
}

.table-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-bottom: 12px;
}

.table-info span {
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
}

.dealer-area {
  text-align: center;
  margin-bottom: 28px;
}

.dealer-area h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.dealer-label {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 6px;
}

.players-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.player-seat {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px;
  min-width: 130px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.player-seat.active {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
}

.player-seat.human {
  border-color: rgba(212, 175, 55, 0.4);
}

.player-seat .name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.player-seat .bankroll {
  font-size: 0.72rem;
  opacity: 0.8;
}

.player-seat .bet {
  font-size: 0.75rem;
  color: var(--gold-light);
  margin: 4px 0;
}

.hands-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hand .total {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-light);
}

.cards {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  width: 52px;
  height: 72px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--card-shadow);
  position: relative;
  line-height: 1.1;
}

.card.red {
  color: #c0392b;
}

.card.black {
  color: #1a1a1a;
}

.card .suit {
  font-size: 0.85rem;
}

.card.hidden {
  background: linear-gradient(135deg, #1a3a6b, #0d2240);
  color: transparent;
  border: 2px solid #2a5a9b;
}

.card.hidden::after {
  content: '🂠';
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
  position: absolute;
}

.result-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.result-badge.win { background: #27ae60; }
.result-badge.lose { background: #c0392b; }
.result-badge.push { background: #7f8c8d; }
.result-badge.blackjack { background: var(--gold); color: #1a1a1a; }
.result-badge.surrender { background: #8e44ad; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 16px;
}

.card-panel h2 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.bet-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bet-controls label {
  font-size: 0.8rem;
  opacity: 0.85;
}

.bet-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bet-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--cream);
  font-size: 1rem;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.chip:hover { transform: scale(1.1); }
.chip-15 { background: #3498db; }
.chip-25 { background: #27ae60; }
.chip-50 { background: #e67e22; }
.chip-100 { background: #2c3e50; border-color: var(--gold); color: var(--gold); }
.chip-500 { background: #8e44ad; }

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  color: #1a1a1a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--cream);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-action {
  background: rgba(255, 255, 255, 0.15);
  color: var(--cream);
  flex: 1;
  min-width: 80px;
}

.btn-action.double { border-bottom: 3px solid #27ae60; }
.btn-action.split { border-bottom: 3px solid var(--gold); }
.btn-action.surrender { border-bottom: 3px solid #8e44ad; }

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-controls {
  display: flex;
  gap: 8px;
}

.message-bar {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  min-height: 40px;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.feedback-item {
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.feedback-item.correct {
  background: rgba(39, 174, 96, 0.15);
  border-left: 3px solid #27ae60;
}

.feedback-item.incorrect {
  background: rgba(192, 57, 43, 0.15);
  border-left: 3px solid #c0392b;
}

.feedback-item .hand-desc {
  font-weight: 600;
  color: var(--gold-light);
}

.feedback-item .vs {
  opacity: 0.7;
  font-size: 0.75rem;
  margin-top: 4px;
}

.feedback-summary {
  font-size: 0.85rem;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.feedback-summary.good { background: rgba(39, 174, 96, 0.2); color: #2ecc71; }
.feedback-summary.mixed { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.feedback-summary.bad { background: rgba(192, 57, 43, 0.2); color: #e74c3c; }

.rules-list {
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.8;
}

.rules-list li {
  margin-left: 16px;
}

.dealer-timer {
  color: var(--gold-light);
  font-weight: 600;
}

.shoe-meter {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.shoe-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #f1c40f, #e74c3c);
  transition: width 0.3s;
}

.empty-feedback {
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
  padding: 20px;
}
