* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
}

.panel {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.hidden {
  display: none;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.card {
  width: 64px;
  height: 90px;
  border-radius: 10px;
  border: 2px solid #1f2937;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-3px);
}

.red-card {
  color: #dc2626;
}

.black-card {
  color: #111827;
}

.card.selected {
  background: #dbeafe;
  border-color: #2563eb;
}

.card.secret {
  background: #fef3c7;
  border-color: #f59e0b;
}

.card.discarded {
  background: #fee2e2;
  border-color: #dc2626;
}

.card.kept {
  background: #dcfce7;
  border-color: #16a34a;
}

.card.face-down {
  background: repeating-linear-gradient(
    45deg,
    #1f2937,
    #1f2937 8px,
    #374151 8px,
    #374151 16px
  );
  color: transparent;
}

.cards.small .card {
  width: 52px;
  height: 72px;
  font-size: 16px;
}

.pile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pile-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 16px 0;
}

label {
  font-weight: bold;
}

button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .pile-grid,
  .pile-grid.two {
    grid-template-columns: 1fr;
  }

  .card {
    width: 52px;
    height: 72px;
    font-size: 16px;
  }
}