.solitaire-surface {
  display: grid;
  gap: var(--space-4);
}

.table-top-row,
.piles-group,
.foundation-group,
.tableau-row {
  display: flex;
  gap: 0.75rem;
}

.table-top-row {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.foundation-group,
.tableau-row {
  flex-wrap: wrap;
}

.card-slot,
.card {
  width: 72px;
  height: 100px;
  border-radius: 14px;
}

.card-slot {
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03);
  position: relative;
}

.stock-slot {
  cursor: pointer;
}

.card {
  border: 1px solid rgba(10, 15, 24, 0.35);
  background: linear-gradient(180deg, #fffdf8, #f0ebdf);
  color: #17212f;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.45rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

.card.red { color: #be4a5d; }
.card.black { color: #17212f; }
.card.back {
  background: linear-gradient(180deg, #223a62, #172746);
  color: #cfe7ff;
  border-color: rgba(116,215,255,0.2);
}

.card.selected {
  outline: 2px solid rgba(116, 215, 255, 0.55);
  transform: translateY(-6px);
}

.card-top,
.card-bottom {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.card-bottom {
  align-items: flex-end;
  transform: rotate(180deg);
}

.card-center {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
}

.tableau-pile,
.foundation-pile,
.waste-pile {
  position: relative;
  min-width: 72px;
  min-height: 100px;
}

.tableau-pile {
  padding-bottom: 3rem;
}

.tableau-pile .card,
.waste-pile .card {
  position: absolute;
  left: 0;
}

.empty-pile-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(244,241,232,0.45);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .card-slot,
  .card,
  .tableau-pile,
  .foundation-pile,
  .waste-pile {
    width: 58px;
    min-width: 58px;
    height: 84px;
    min-height: 84px;
  }

  .tableau-pile {
    padding-bottom: 2.4rem;
  }

  .tableau-row,
  .foundation-group,
  .piles-group {
    gap: 0.45rem;
  }

  .card-center {
    font-size: 1.25rem;
  }
}
