.hearts-game {
	background:
		radial-gradient(circle at 50% 42%, rgba(31, 141, 97, 0.28), transparent 44%),
		linear-gradient(135deg, #0b4d39, #073026 62%, #05251e);
	border-radius: 18px;
	box-sizing: border-box;
	color: #fff;
	display: flex;
	flex-direction: column;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	min-height: 532px;
	overflow: hidden;
	position: relative;
}

.hearts-game::before {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
	background-size: 24px 24px;
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.hearts-toolbar {
	align-items: center;
	background: rgba(3, 23, 18, 0.68);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr auto 1fr;
	padding: 10px 14px;
	position: relative;
	z-index: 20;
}

.hearts-toolbar__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.hearts-toolbar button,
.hearts-passbar button,
.hearts-result button {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-size: 12px;
	font-weight: 850;
	min-height: 38px;
	padding: 8px 14px;
}

.hearts-toolbar button:hover:not(:disabled),
.hearts-passbar button:hover:not(:disabled),
.hearts-result button:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.17);
	transform: translateY(-1px);
}

.hearts-toolbar button.is-primary,
.hearts-passbar button,
.hearts-result button {
	background: linear-gradient(180deg, #f6d36b, #dba42a);
	border-color: transparent;
	color: #152019;
}

.hearts-toolbar button:disabled,
.hearts-passbar button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.hearts-title {
	text-align: center;
}

.hearts-title small {
	color: rgba(255, 255, 255, 0.68);
	display: block;
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.hearts-title h2 {
	color: #fff;
	font-size: clamp(24px, 3vw, 35px);
	line-height: 1;
	margin: 2px 0 0;
}

.hearts-toolbar__meta {
	align-items: flex-end;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hearts-toolbar__meta span {
	color: #ffbdc5;
	font-size: 11px;
	font-weight: 800;
}

.hearts-toolbar__meta strong {
	color: #f6d36b;
	font-size: 18px;
}

.hearts-mobile-note {
	background: rgba(246, 211, 107, 0.12);
	color: #f9e59e;
	display: none;
	font-size: 11px;
	font-weight: 750;
	padding: 6px 10px;
	position: relative;
	text-align: center;
	z-index: 12;
}

.hearts-board-scroll {
	flex: 1;
	overflow-x: auto;
	overflow-y: hidden;
	position: relative;
	z-index: 2;
}

.hearts-board {
	box-sizing: border-box;
	display: grid;
	grid-template-areas:
		"score top top"
		"left center right"
		"player player player";
	grid-template-columns: 180px minmax(430px, 1fr) 180px;
	grid-template-rows: 68px 220px minmax(190px, auto);
	min-height: 470px;
	min-width: 830px;
	padding: 10px 14px 14px;
	position: relative;
}

.hearts-scoreboard {
	align-self: start;
	background: rgba(3, 23, 18, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	grid-area: score;
	margin-right: 10px;
	overflow: hidden;
	padding: 8px;
	z-index: 8;
}

.hearts-score-head,
.hearts-score-row {
	align-items: center;
	display: grid;
	gap: 5px;
	grid-template-columns: 1fr 42px 42px;
	padding: 4px 5px;
}

.hearts-score-head {
	color: rgba(255, 255, 255, 0.55);
	font-size: 8px;
	font-weight: 900;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.hearts-score-row {
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	font-size: 11px;
}

.hearts-score-row.is-player {
	color: #f6d36b;
	font-weight: 850;
}

.hearts-score-row b,
.hearts-score-row strong,
.hearts-score-head b,
.hearts-score-head strong {
	text-align: center;
}

.hearts-scoreboard p {
	color: rgba(255, 255, 255, 0.52);
	font-size: 8px;
	line-height: 1.35;
	margin: 5px 4px 0;
}

.hearts-opponent {
	align-items: center;
	color: rgba(255, 255, 255, 0.75);
	display: flex;
	font-size: 11px;
	font-weight: 850;
	gap: 9px;
	justify-content: center;
	position: relative;
	z-index: 5;
}

.hearts-opponent--top {
	flex-direction: column;
	grid-area: top;
}

.hearts-opponent--left {
	flex-direction: column;
	grid-area: left;
}

.hearts-opponent--right {
	flex-direction: column;
	grid-area: right;
}

.hearts-opponent-cards {
	height: 48px;
	position: relative;
	width: 94px;
}

.hearts-card-back {
	background:
		linear-gradient(45deg, rgba(255,255,255,.14) 25%, transparent 25%) 0 0 / 12px 12px,
		linear-gradient(-45deg, rgba(255,255,255,.14) 25%, transparent 25%) 0 0 / 12px 12px,
		#203f84;
	border: 3px solid #f3f5f8;
	border-radius: 5px;
	box-shadow: 0 3px 8px rgba(0,0,0,.28);
	height: 46px;
	left: calc(var(--i) * 6px);
	position: absolute;
	top: 0;
	width: 34px;
}

.hearts-opponent-cards b {
	background: #f6d36b;
	border-radius: 999px;
	bottom: -4px;
	color: #142019;
	font-size: 9px;
	padding: 2px 5px;
	position: absolute;
	right: 0;
	z-index: 10;
}

.hearts-table-center {
	align-self: stretch;
	background:
		radial-gradient(circle, rgba(255,255,255,.05), transparent 62%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 50%;
	grid-area: center;
	justify-self: center;
	position: relative;
	width: min(100%, 430px);
}

.hearts-table-mark {
	color: rgba(255, 119, 136, 0.14);
	font-size: 82px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.hearts-trick {
	height: 78px;
	position: absolute;
	width: 56px;
	z-index: 5;
}

.hearts-trick--top {
	left: 50%;
	top: 5px;
	transform: translateX(-50%);
}

.hearts-trick--left {
	left: 58px;
	top: 50%;
	transform: translateY(-50%) rotate(-7deg);
}

.hearts-trick--right {
	right: 58px;
	top: 50%;
	transform: translateY(-50%) rotate(7deg);
}

.hearts-trick--bottom {
	bottom: 5px;
	left: 50%;
	transform: translateX(-50%);
}

.hearts-trick-slot {
	border: 2px dashed rgba(255, 255, 255, 0.12);
	border-radius: 7px;
	display: block;
	height: 100%;
	width: 100%;
}

.hearts-trick-card,
.hearts-trick-card .hearts-card {
	height: 100%;
	width: 100%;
}

.hearts-player {
	align-self: end;
	grid-area: player;
	position: relative;
	z-index: 12;
}

.hearts-player__status {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-bottom: 6px;
	min-height: 24px;
	text-align: center;
}

.hearts-player__status span {
	background: rgba(246, 211, 107, 0.15);
	border: 1px solid rgba(246, 211, 107, 0.36);
	border-radius: 999px;
	color: #f6d36b;
	font-size: 9px;
	font-weight: 900;
	padding: 4px 8px;
	text-transform: uppercase;
}

.hearts-player__status strong {
	color: rgba(255, 255, 255, 0.78);
	font-size: 11px;
}

.hearts-hand {
	align-items: flex-end;
	display: flex;
	justify-content: center;
	min-height: 128px;
	overflow: visible;
	padding: 0 15px;
}

.hearts-hand .hearts-card {
	flex: 0 0 76px;
	margin-left: -24px;
	transition: margin 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.hearts-hand .hearts-card:first-child {
	margin-left: 0;
}

.hearts-hand .hearts-card:hover:not(:disabled),
.hearts-hand .hearts-card.is-selected {
	margin-left: -18px;
	transform: translateY(-16px);
	z-index: 30;
}

.hearts-hand .hearts-card:first-child:hover:not(:disabled),
.hearts-hand .hearts-card:first-child.is-selected {
	margin-left: 0;
}

.hearts-card {
	aspect-ratio: 0.72;
	background: linear-gradient(145deg, #fff, #edf0f4);
	border: 1px solid rgba(0, 0, 0, 0.22);
	border-radius: 8px;
	box-shadow: 0 7px 13px rgba(0, 0, 0, 0.28);
	box-sizing: border-box;
	color: #101318;
	cursor: pointer;
	height: 108px;
	padding: 0;
	position: relative;
	user-select: none;
}

.hearts-card--red {
	color: #d82f46;
}

.hearts-card.is-legal {
	box-shadow:
		0 0 0 2px rgba(116, 229, 178, 0.55),
		0 7px 13px rgba(0, 0, 0, 0.28);
}

.hearts-card.is-selected {
	box-shadow:
		0 0 0 4px #f6d36b,
		0 12px 20px rgba(0, 0, 0, 0.36);
}

.hearts-card.is-disabled,
.hearts-card:disabled {
	cursor: not-allowed;
	filter: saturate(0.65);
	opacity: 0.6;
}

.hearts-card__corner {
	font-size: 16px;
	font-weight: 900;
	left: 6px;
	line-height: 0.82;
	position: absolute;
	top: 6px;
}

.hearts-card__corner b,
.hearts-card__corner small {
	display: block;
}

.hearts-card__corner small {
	font-size: 13px;
	margin-top: 4px;
}

.hearts-card__corner--bottom {
	bottom: 6px;
	left: auto;
	right: 6px;
	top: auto;
	transform: rotate(180deg);
}

.hearts-card > strong {
	font-size: 37px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.hearts-passbar {
	align-items: center;
	background: rgba(3, 23, 18, 0.56);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	display: flex;
	gap: 13px;
	justify-content: center;
	margin: 6px auto 0;
	max-width: 330px;
	padding: 5px 7px 5px 14px;
}

.hearts-passbar span {
	color: rgba(255,255,255,.72);
	font-size: 11px;
}

.hearts-passbar span b {
	color: #f6d36b;
}

.hearts-result {
	background: rgba(3, 23, 18, 0.92);
	border: 1px solid rgba(246, 211, 107, 0.4);
	border-radius: 16px;
	left: 50%;
	padding: 18px;
	position: absolute;
	text-align: center;
	top: 40%;
	transform: translate(-50%, -50%);
	width: min(320px, 80%);
	z-index: 80;
}

.hearts-result h3 {
	color: #f6d36b;
	margin: 0 0 12px;
}

@media (max-width: 900px) {
	.hearts-toolbar {
		grid-template-columns: 1fr auto;
	}

	.hearts-title {
		display: none;
	}

	.hearts-board {
		grid-template-columns: 150px minmax(400px, 1fr) 150px;
		min-width: 760px;
	}
}

@media (max-width: 700px) {
	.hearts-game {
		border-radius: 10px;
		min-height: 486px;
	}

	.hearts-toolbar {
		padding: 7px;
	}

	.hearts-toolbar button {
		font-size: 10px;
		min-height: 33px;
		padding: 6px 10px;
	}

	.hearts-toolbar__meta span {
		font-size: 9px;
	}

	.hearts-toolbar__meta strong {
		font-size: 15px;
	}

	.hearts-mobile-note {
		display: block;
	}

	.hearts-board {
		grid-template-columns: 135px 390px 135px;
		grid-template-rows: 60px 205px minmax(175px, auto);
		min-width: 700px;
		padding: 7px 9px 10px;
	}

	.hearts-scoreboard {
		padding: 5px;
	}

	.hearts-score-row {
		font-size: 9px;
	}

	.hearts-hand .hearts-card {
		flex-basis: 66px;
		margin-left: -23px;
	}

	.hearts-card {
		height: 94px;
	}

	.hearts-card > strong {
		font-size: 31px;
	}

	.hearts-card__corner {
		font-size: 14px;
	}

	.hearts-player__status strong {
		font-size: 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hearts-hand .hearts-card,
	.hearts-toolbar button,
	.hearts-passbar button {
		transition: none;
	}
}
