* {
  box-sizing: border-box;
}

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

.app {
  max-width: 1050px;
  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;
  position: relative;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

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

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

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

.red-card {
  color: #dc2626;
}

.black-card {
  color: #111827;
}

.positionLabel {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  color: #6b7280;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.column {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
}

.column h3 {
  text-align: center;
  margin-top: 0;
}

.columnCards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  min-height: 510px;
  margin-bottom: 14px;
}

.columnCards .card {
  width: 58px;
  height: 78px;
  font-size: 18px;
}

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

button:hover {
  background: #1d4ed8;
}

.columnBtn {
  width: 100%;
}

.revealBox {
  background: #f9fafb;
  border: 2px dashed #9ca3af;
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}

#revealedCard {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

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

  .columnCards {
    min-height: auto;
  }

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