html {
	background-color: #092E20;
	overflow-x: hidden;
}

body {
	position: relative;
	border-radius: 8px;
	box-shadow: black 0px 0px 2px;
	max-width: 640px;
	width: 100%;
	box-sizing: border-box;
	background: #FFF;
	margin: 20px auto;
	border: solid 1px black;
	font-family: arial, sans-serif;
	padding: 20px;
}

h1 {
	font-size: 40px;
	text-align: center;
	padding: 0px;
	margin: 10px auto;
}

#card-table-wrapper {
	margin-bottom: 20px;
	overflow: hidden;
	width: 100%;
	position: relative;
}

#card-table {
	background-color: green;
	height: 400px;
	width: 540px;
	margin: 0 auto;
	border: solid 6px brown;
	border-radius: 8px;
	-webkit-border-radius: 8px;
	-moz-border-radius: 8px;
	-ms-border-radius: 8px;
	-o-border-radius: 8px;
	box-shadow: #111 1px 1px 2px;
	position: relative;
	transform-origin: top left;
}

.position-label {
	position: absolute;
	font-weight: bold;
	color: #FFF;
	font-size: 12px;
	text-shadow: 1px 1px 2px #000;
	z-index: 5;
}

#north-label {
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
}

#south-label {
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
}

#east-label {
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
}

#west-label {
	top: 50%;
	left: 10px;
	transform: translateY(-50%);
}

.rotated-90 {
	writing-mode: vertical-rl;
	text-orientation: mixed;
	transform: rotate(180deg);
}

#game-info {
	text-align: center;
	font-size: 14px;
	font-weight: bold;
	color: #333;
	margin: 4px 0 12px;
}

.score-sep {
	margin: 0 10px;
	color: #999;
}

button {
	height: 35px;
	padding: 0 20px;
	margin: 10px 5px;
	cursor: pointer;
	background: #0066CC;
	color: white;
	border: none;
	border-radius: 4px;
	font-weight: bold;
	font-size: 14px;
}

button:hover {
	background: #0052A3;
}

button:active {
	opacity: 0.8;
}

img.preload {
	display: none;
}

#deal {
	position: absolute;
	left: 50%;
	top: 70%;
	transform: translate(-50%, -50%);
	z-index: 20;
}

#reset {
	position: absolute;
	left: 50%;
	top: 70%;
	transform: translate(-50%, -50%);
	z-index: 20;
}

#turn-arrow-outer {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(0deg);
	z-index: 1001;
	transition: transform 0.35s ease;
	pointer-events: none;
}

@keyframes arrow-bounce {
	0%, 100% { transform: translateY(0); }
	50%       { transform: translateY(-22px); }
}

#turn-arrow {
	width: 48px;
	height: 84px;
	display: flex;
	flex-direction: column;
	align-items: center;
	filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.55));
	animation: arrow-bounce 0.75s ease-in-out infinite;
}

#turn-arrow::before {
	content: '';
	width: 0;
	height: 0;
	border-left: 24px solid transparent;
	border-right: 24px solid transparent;
	border-bottom: 46px solid rgba(255, 255, 255, 0.25);
}

#turn-arrow::after {
	content: '';
	width: 12px;
	height: 38px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 0 0 3px 3px;
}

#trick-play-area {
	position: absolute;
	width: 200px;
	height: 200px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 15;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 10px;
}

.trick-card-container {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	font-size: 10px;
	font-weight: bold;
}

#north-card {
	top: 35px;
	left: 50%;
	transform: translateX(-50%);
}

#south-card {
	bottom: 35px;
	left: 50%;
	transform: translateX(-50%);
}

#west-card {
	left: 35px;
	top: 50%;
	transform: translateY(-50%);
}

#east-card {
	right: 35px;
	top: 50%;
	transform: translateY(-50%);
}

#trick-history-area {
	margin-top: 16px;
	padding: 0 4px;
}

#trick-history-area h3 {
	font-size: 13px;
	font-weight: bold;
	color: #555;
	margin: 0 0 8px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.trick-history-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-start;
}

.trick-history-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

.trick-winner-label {
	font-size: 10px;
	font-weight: bold;
	padding: 1px 6px;
	border-radius: 3px;
	line-height: 1.5;
}

.trick-winner-label.ns-win {
	background: #dbeafe;
	color: #1e40af;
}

.trick-winner-label.ew-win {
	background: #fce7f3;
	color: #9d174d;
}

footer {
	font-size: 12px;
	color: grey;
	margin-top: 20px;
	text-align: center;
}

footer a, footer a:visited {
	color: grey;
}

footer a:hover {
	color: black;
}

.card-playable {
	cursor: pointer !important;
	box-shadow: inset 0 0 10px rgba(0, 200, 0, 0.5) !important;
}

.card-played {
	opacity: 0.7;
}

@media (max-width: 640px) {
	html, body {
		margin: 0;
		padding: 0;
		width: 100%;
		max-width: 100%;
		min-height: 100vh;
		overflow-x: hidden;
	}

	html {
		background: #fff;
	}

	body {
		border: none;
		border-radius: 0;
		box-shadow: none;
		background: #fff;
	}

	h1, footer {
		display: none;
	}

	#game-info {
		padding: 6px 0 4px;
		margin: 0;
		font-size: 13px;
	}

	#trick-history-area {
		padding: 8px 10px;
	}

	#card-table-wrapper {
		margin-bottom: 0;
	}

	#card-table {
		border-width: 5px;
	}
}
