* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, #1d6a43 0%, #0f4b2f 45%, #08311f 100%);
  color: #f7f3e9;
  padding: 20px;
}

.game-container {
  max-width: 1200px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  border: 2px solid rgba(255, 215, 130, 0.35);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}

.top-bar h1 {
  font-size: 2.2rem;
  color: #ffd27a;
}

.subtitle {
  margin-top: 6px;
  color: #f6edd5;
  opacity: 0.9;
}

.scoreboard {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.score-item {
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 130, 0.35);
  text-align: center;
}

.score-label {
  display: block;
  font-size: 0.85rem;
  color: #f6edd5;
  opacity: 0.9;
  margin-bottom: 6px;
}

.score-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffd27a;
}

.table {
  border: 3px solid rgba(255, 215, 130, 0.35);
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.16));
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.table-section {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.14);
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.4rem;
  color: #fff4d6;
}

.score-chip {
  background: rgba(255, 215, 130, 0.14);
  border: 1px solid rgba(255, 215, 130, 0.35);
  color: #ffd27a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: bold;
}

.cards-area {
  min-height: 170px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.center-panel {
  text-align: center;
  padding: 16px 10px 26px;
}

.status-message {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 130, 0.25);
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff4d6;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: #ffd27a;
  color: #1d1d1d;
  box-shadow: 0 6px 18px rgba(255, 210, 122, 0.25);
}

.btn-secondary {
  background: #f6edd5;
  color: #1d1d1d;
}

.legend {
  color: #f6edd5;
  opacity: 0.9;
}

.card {
  width: 100px;
  height: 140px;
  background: #ffffff;
  border-radius: 14px;
  border: 2px solid #d8d8d8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #111;
  animation: dealCard 0.25s ease;
}

.card.red {
  color: #c62828;
}

.card.black {
  color: #111111;
}

.card-top,
.card-bottom {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-weight: bold;
}

.card-top {
  align-items: flex-start;
}

.card-bottom {
  align-items: flex-end;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 1.2rem;
}

.card-suit-small {
  font-size: 1rem;
  margin-top: 2px;
}

.card-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
}

.card-back {
  background:
    linear-gradient(135deg, #173b7a 0%, #0f2854 100%);
  border-color: #f6edd5;
  overflow: hidden;
}

.card-back::before,
.card-back::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 10px;
}

.card-back .back-pattern {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.18);
  font-size: 2.8rem;
  font-weight: bold;
}

.result-win {
  color: #b8ffbf;
}

.result-lose {
  color: #ffb8b8;
}

.result-draw {
  color: #ffe4a8;
}

@keyframes dealCard {
  from {
    transform: translateY(-10px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .scoreboard {
    width: 100%;
  }

  .score-item {
    flex: 1;
  }

  .card {
    width: 84px;
    height: 120px;
  }

  .card-center {
    font-size: 2.4rem;
  }

  .card-rank {
    font-size: 1rem;
  }
}