:root {
	--cardHeightRatio: 1.5;
	--cardWidth: 70px;
	--cardHeight: calc(var(--cardWidth) * var(--cardHeightRatio));
	--gridHorizontalSpacing: 10px;
	--gridVerticalSpacing: calc(var(--gridHorizontalSpacing) * var(--cardHeightRatio));
	--gridWidth: calc(var(--cardWidth) * 5 + var(--gridHorizontalSpacing) * 4);
	--corner: 8px;
}

body {
	overscroll-behavior: none;
	-webkit-overflow-scrolling: auto;
	font-family: sans-serif;
	user-select: none;
	margin: 0px;
	padding: 20px;
	padding-top: 0px;
}
#title-image {
	max-width: var(--gridWidth);
	padding-top: 0px;
	margin-top: 0px;
}

game {
	overflow: hidden;
	max-width: var(--gridWidth);
}
img {
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-o-user-select: none;
	user-select: none;
}

.about {
	max-width: 600px;
}

.grid {
	display: grid;
	grid-template-rows: 1fr 1fr 1fr;
	grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
	grid-gap: var(--gridVerticalSpacing) var(--gridHorizontalSpacing);
	width: var(--gridWidth);
	grid-template-areas:
		'r0c0 r0c1 r0c2 r0c3 r0c4'
		'r1c0 r1c1 r1c2 r1c3 r1c4'
		'r2c0 r2c1 r2c2 r2c3 r2c4';
}

.ui-container {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
	grid-gap: var(--gridVerticalSpacing) var(--gridHorizontalSpacing);
	width: var(--gridWidth);
	margin-bottom: 10px;
}

.card-container {
	position: relative;
	display: inline-block;
	text-align: center;
}

.deck {
	box-sizing: border-box;
	width: var(--cardWidth);
	height: var(--cardHeight);
	padding: 10px;
	position: relative;
	bottom: 0px;
	display: inline-block;
}

.card {
	z-index: 1000;
	position: absolute;
	display: inline-block;
	background-color: white;
	top: 0;
	left: 0;
	box-sizing: border-box;
	border: 1px solid black;
	width: var(--cardWidth);
	height: var(--cardHeight);
	border-radius: var(--corner);
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.active.card {
	cursor: grab;
	transition: box-shadow 0.1s ease-out;
	-webkit-box-shadow: 5px 5px 4px -1px rgba(0, 0, 0, 0.39);
	box-shadow: 5px 5px 4px -1px rgba(0, 0, 0, 0.39);
}

.dragging.active.card {
	cursor: grabbing;
	-webkit-box-shadow: 15px 15px 4px -1px rgba(0, 0, 0, 0.39);
	box-shadow: 15px 15px 4px -1px rgba(0, 0, 0, 0.39);
}

.card.placed {
	z-index: auto;
}

.card-space {
	padding: 0px;
	position: relative;
	/* border: 1px dotted black; */
	background-color: #eee;
	width: var(--cardWidth);
	height: var(--cardHeight);
	border-radius: var(--corner);
	box-sizing: border-box;
}

.card-space.occupied {
	border: 0px;
}

.targeted {
	background: #ddd;
	border: 3px solid black;
}

.row0-backing {
	grid-row-start: 1;
	grid-row-end: 1;
	grid-column-start: 1;
	grid-column-end: 6;
	border-radius: var(--corner);
	transition-property:
		box-shadow,
		-webkit-box-shadow;
}

.row1-backing {
	grid-row-start: 2;
	grid-row-end: 2;
	grid-column-start: 1;
	grid-column-end: 6;
	border-radius: var(--corner);
	transition-property:
		box-shadow,
		-webkit-box-shadow;
}

.row2-backing {
	grid-row-start: 3;
	grid-row-end: 3;
	grid-column-start: 1;
	grid-column-end: 6;
	border-radius: var(--corner);
	transition-property:
		box-shadow,
		-webkit-box-shadow;
}

.row0-backing.locked,
.row1-backing.locked,
.row2-backing.locked {
	background: rgb(0, 34, 255);
	background: linear-gradient(
		0deg,
		rgba(0, 34, 255, 0.3365736970684039) 0%,
		rgba(253, 29, 29, 0) 100%
	);
}
.score {
	grid-column-end: span 3;
}

.total-score {
	font-size: 1.7rem;
}
span[data-handname] {
	cursor: help;
}

.last-score,
.hand-record {
	font-size: 0.7rem;
	color: #333;
	margin-top: 10px;
}

.hand-history {
	height: 200px;
	overflow-y: scroll;
	overflow-x: hidden;
	margin-bottom: 50px;
}

.face-down.card {
	z-index: auto;
	border: 1px solid rgba(0, 0, 0, 0.5);
	background: rgb(0, 34, 255);
	background: linear-gradient(
		180deg,
		rgba(0, 34, 255, 1) 0%,
		rgba(255, 255, 255, 1) 47%,
		rgba(253, 29, 29, 1) 47%,
		rgba(252, 255, 0, 1) 100%
	);
}

.remaining-count {
	position: absolute;
	bottom: 10px;
	left: 10px;
	display: inline-block;
	background-color: white;
	border: 1px solid black;
	border-radius: 25px;
	font-weight: bold;
	font-size: 1.5rem;
	padding: 10px;
}

.hand-check-item.done {
	text-decoration: line-through;
	color: red;
}

.hand-check-item.todo {
	font-weight: bold;
}

.hand-check-item:hover {
	color: white;
	background: blue;
}

td.num {
	text-align: right;
}

.tooltip {
	position: fixed;
	background: #fff;
	border: 1px solid black;
	border-radius: var(--corner);
	padding: 10px;
	transition-property: opacity;
}

.tooltip-title {
	font-weight: bold;
}

.info {
	background: white;
	color: blue;
	position: fixed;
	display: inline-block;
	bottom: 0px;
	right: 0px;
	margin-right: 10px;
}
.info a {
	color: blue;
}
.info a:hover {
	background: blue;
	color: white;
}

/* Maximum width */
@media (max-width: 410px) {
	body {
		padding: 0px;
	}
}

.hand-cards {
	display: inline-block;
}

.hand-card {
	display: inline-block;
	width: 20px;
	margin: 3px;
}
.hand-score {
	display: inline-block;
}
.hand-name {
	display: inline-block;
	font-weight: bold;
	margin-left: 4px;
}

.game-over {
	display: none;
	background-image: url('images/game-over.svg');
	background-size: 33%;
	width: 100vw;
	height: 100vh;
	padding: 0px;
	margin: 0px;
	background-color: rgba(255, 255, 255, 0.7);
	box-sizing: border-box;
}
.game-over div {
	align-self: center;
	color: white;
	margin: 10px;
	padding: 10px;
	padding-right: 20px;
	padding-left: 20px;
	background-color: rgba(0, 0, 0, 1);
	font-size: 90px;
	font-weight: bolder;
	-webkit-box-shadow: 10px 10px 4px -1px rgba(0, 0, 0, 0.39);
	box-shadow: 10px 10px 4px -1px rgba(0, 0, 0, 0.39);
}

.game-over .restart-ui {
	padding: 0px;
	font-size: 15px;
}

.restart-ui .restart-button {
	font-size: 50px;
	background: white;
	border-width: 10px;
}

.game-over.overlay {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	position: fixed;
	top: 0px;
	left: 0px;
}

.body-container {
	display: block;
}
