* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at 40% 20%, #0a5c2e, #084626);
  color: #f2f2f2;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

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

button {
  background: #1b7f3b;
  color: white;
  border: 1px solid #0e5a28;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.board {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upper {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 24px;
}

.pile {
  position: relative;
  min-height: 120px;
}

.slot {
  width: 88px;
  height: 120px;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  position: relative;
  z-index: 1;
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.tableau-col {
  position: relative;
  width: 88px;
  min-height: 120px;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 88px;
  height: 120px;
  border-radius: 8px;
  background: white;
  color: #111;
  border: 2px solid #d8d8d8;
  box-shadow: 0 4px 8px rgba(0,0,0,0.35);
  user-select: none;
  z-index: 2;
}

.card.face-down {
  background: repeating-linear-gradient(45deg, #0d3e20, #0d3e20 8px, #12502a 8px, #12502a 16px);
  border-color: #0a2e17;
  color: transparent;
}

.card .corner {
  position: absolute;
  font-weight: 700;
  line-height: 1.05;
}

.corner.tl { top: 6px; left: 8px; text-align: left; }
.corner.br { bottom: 6px; right: 8px; transform: rotate(180deg); text-align: right; }

.suit {
  font-size: 16px;
}

.rank {
  font-size: 16px;
  font-weight: 700;
}

.red { color: #c01818; }
.black { color: #111; }

.foundation-slot, .stock-slot, .waste-slot { position: relative; }
.waste-slot { grid-column: span 2; }
.waste-slot .card { left: 0; }
.foundation-slot .card { left: 0; }

.hint {
  opacity: 0.85;
  font-size: 12px;
}

.footer {
  margin-bottom: 38px;
  font-size: 12px;
  opacity: 0.8;
}

