.cruel {
	margin: 0 auto;
	max-width: 860px;
}

.cruel .cruel-body {
	background-color: green;
	padding: 10px;
	border-radius: 6px;
	max-height: 900px;
	height: 200vh;
	margin: 6px 0 30px;
}

.cruel #table {
	display: grid;
	grid-template-rows: 1fr 0.6em 1fr 0.8fr 1fr;
	grid-template-columns: repeat(6, 1fr);
	aspect-ratio: 6 / 5;
	column-gap: 0.6em;
	row-gap: 0;
	margin: 0 auto;
	max-width: 860px;
}

.cruel #table>div {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Stock pile - top left */
.cruel #stock {
	grid-area: 1/1/2/2;
	font-size: 60px;
	font-weight: bold;
	color: transparent;
	cursor: pointer;
}
.cruel #stock img {
	width: 50%;
}

.cruel #stock.no-moves {
	color: red;
}

/* Foundations - top row, right side (4 foundations) */
.cruel #foundation-spades {
	grid-area: 1/3/2/4;
}

.cruel #foundation-hearts {
	grid-area: 1/4/2/5;
}

.cruel #foundation-diamonds {
	grid-area: 1/5/2/6;
}

.cruel #foundation-clubs {
	grid-area: 1/6/2/7;
}

/* Tableau piles - 12 piles in 2 rows of 6 columns each */
/* Row 3 is first tableau row, row 5 is second tableau row (row 2 and 4 are spacers) */
.cruel #pile1 {
	grid-area: 3/1/4/2;
}

.cruel #pile2 {
	grid-area: 3/2/4/3;
}

.cruel #pile3 {
	grid-area: 3/3/4/4;
}

.cruel #pile4 {
	grid-area: 3/4/4/5;
}

.cruel #pile5 {
	grid-area: 3/5/4/6;
}

.cruel #pile6 {
	grid-area: 3/6/4/7;
}

.cruel #pile7 {
	grid-area: 5/1/6/2;
}

.cruel #pile8 {
	grid-area: 5/2/6/3;
}

.cruel #pile9 {
	grid-area: 5/3/6/4;
}

.cruel #pile10 {
	grid-area: 5/4/6/5;
}

.cruel #pile11 {
	grid-area: 5/5/6/6;
}

.cruel #pile12 {
	grid-area: 5/6/6/7;
}

.cruel .pile {
	width: 100%;
	border-radius: 6%;
	border: 1px solid #333;
	user-select: none;
	position: relative;
	cursor: pointer;
	font-size: 40px;
	overflow: visible;
}

.cruel #pile1, .cruel #pile2, .cruel #pile3, .cruel #pile4,
.cruel #pile5, .cruel #pile6, .cruel #pile7, .cruel #pile8,
.cruel #pile9, .cruel #pile10, .cruel #pile11, .cruel #pile12 {
	overflow: visible;
}

.cruel .card {
	width: 100%;
	height: 100%;
	display: inline-flex;
	justify-content: center;
	font-size: 20px;
	font-weight: bold;
	background-color: white;
	user-select: none;
	cursor: pointer;
	position: absolute;
}

.cruel div.card {
	border-radius: 6%;
	border: 2px solid #000;
}

.cruel img.card {
	width: 100%;
	border-radius: 6%;
	border: 1px solid #000;
}

.cruel .card.selected {
	box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.5);
}

.cruel .card.dragging {
	opacity: 0.5;
	cursor: grabbing;
}

.cruel .clubs {
	color: black;
}

.cruel .diamonds {
	color: red;
}

.cruel .hearts {
	color: red;
}

.cruel .spades {
	color: black;
}

.cruel .facedown {
	color: #80917b;
	background-color: #80917b;
}

.cruel .game-over {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	justify-content: center;
	align-items: center;
	z-index: 1001;
	display: flex;
}

.cruel .card-title {
	text-align: center;
	font-size: 1.6em;
}

.cruel .game-over>div {
	background-color: white;
	padding: 20px;
	border-radius: 10px;
	text-align: center;
	color: black;
	width: 380px;
}

.cruel .rules {
	margin-bottom: 4em;
}

.cruel .rules h2 {
	line-height: 2em;
	font-size: 130%;
	font-weight: normal;
}

.cruel .rules p {
	margin-bottom: 1em;
}

.cruel .rules dl {
	text-align: left;
}

.cruel .rules dt {
	font-weight: bold;
	margin-top: 1em;
}

.cruel .rules dd {
	margin-left: 2em;
	margin-bottom: 0.5em;
}

@media (max-width: 900px) {
	.cruel .game-button {
		font-size: .8em;
		padding: .1em .2em;
	}
	.cruel #table {
		gap: 0.4em 0.3em;
	}
}

@media (max-width: 600px) {
	.cruel .game-button {
		font-size: .7em;
		padding: .1em .2em;
	}
	.cruel #table {
		gap: 0.3em 0.2em;
	}

	.cruel .cruel-body {
		max-height: 600px;
	}
}

@media (max-width: 480px) {
	.cruel #table {
		grid-template-rows: 1fr 0.6em 1fr 1fr 1fr;
	}
	.cruel #stock {
		font-size: 50px;
	}	
}

@media (max-width: 360px) {
	.cruel .cruel-body {
		max-height: 400px;
	}
	.cruel #stock {
		font-size: 40px;
	}
}
