.hearts-board {
	position: relative;
	display: block;
	padding: 0 12px 6px;
}

.hearts-rival,
.hearts-player,
.hearts-table,
.hearts-broken-state,
.hearts-round,
.hearts-message,
.hearts-actions {
	position: absolute;
}

.hearts-rival {
	z-index: 3;
}

.hearts-broken-state {
	z-index: 7;
	top: 8px;
	right: 14px;
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 5px 10px 5px 7px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 18px;
	color: rgba(255, 255, 255, .72);
	font-size: 12px;
	font-weight: 700;
	background: rgba(15, 66, 25, .78);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .13);
}

.hearts-broken-state svg {
	width: 21px;
	height: 21px;
	overflow: visible;
}

.hearts-broken-state__heart {
	fill: rgba(255, 255, 255, .08);
	stroke: rgba(255, 255, 255, .72);
	stroke-width: 2;
	transition: fill .2s ease, stroke .2s ease;
}

.hearts-broken-state__crack {
	fill: none;
	stroke: #fff;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
	opacity: 0;
	transition: opacity .2s ease;
}

.hearts-broken-state.is-broken {
	color: #fff;
	border-color: rgba(255, 216, 216, .32);
	background: rgba(128, 27, 37, .86);
}

.hearts-broken-state.is-broken .hearts-broken-state__heart {
	fill: #e53c4d;
	stroke: #fff;
}

.hearts-broken-state.is-broken .hearts-broken-state__crack {
	opacity: 1;
}

.hearts-rival .durak-player-label {
	display: grid;
	min-width: 142px;
}

.hearts-rival--top {
	left: 50%;
	top: 4px;
	width: min(620px, 58vw);
	height: var(--card-height);
	transform: translateX(-50%);
}

.hearts-rival--top .durak-player-label {
	left: calc(-150px - 14px);
	top: 3px;
}

.hearts-rival--left,
.hearts-rival--right {
	top: 48%;
	width: var(--card-width);
	height: min(250px, calc(100% - var(--card-height) * 2 - 120px));
	min-height: calc(var(--card-height) * 1.5);
	transform: translateY(-50%);
}

.hearts-rival--left {
	left: 14px;
}

.hearts-rival--right {
	right: 14px;
}

.hearts-rival--left .durak-player-label {
	left: calc(var(--card-width) + 10px);
	top: 50%;
	transform: translateY(-50%);
}

.hearts-rival--right .durak-player-label {
	left: auto;
	right: calc(var(--card-width) + 10px);
	top: 50%;
	transform: translateY(-50%);
}

.hearts-rival-hand {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.hearts-rival-hand--horizontal .durak-card {
	flex: 0 0 var(--card-width);
	margin-left: calc(var(--card-width) * -.74);
}

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

.hearts-rival-hand--vertical {
	flex-direction: column;
}

.hearts-rival-hand--vertical .durak-card {
	flex: 0 0 var(--card-height);
	margin-top: calc(var(--card-height) * -.82);
}

.hearts-rival-hand--vertical .durak-card:first-child {
	margin-top: 0;
}

.hearts-table {
	z-index: 5;
	left: 50%;
	top: 43%;
	width: calc(var(--card-width) * 3.5);
	height: calc(var(--card-height) * 2.35);
	transform: translate(-50%, -50%);
}

.hearts-table__empty {
	position: absolute;
	inset: 24% 17%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed rgba(255, 255, 255, .2);
	border-radius: 5px;
	color: rgba(255, 255, 255, .43);
	font-size: 12px;
}

.hearts-trick-card {
	position: absolute;
	transition: opacity .15s ease;
}

.hearts-trick-card.is-collecting {
	z-index: 30;
	pointer-events: none;
}

.hearts-take-label {
	position: absolute;
	z-index: 20;
	left: 50%;
	top: 50%;
	padding: 5px 10px;
	border-radius: 14px;
	color: #174622;
	font-size: 11px;
	font-weight: 800;
	white-space: nowrap;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(.82);
	transition: opacity .15s ease, transform .15s ease;
}

.hearts-player .hearts-take-label {
	top: 3px;
}

.hearts-rival.is-taking-trick .hearts-take-label,
.hearts-player.is-taking-trick .hearts-take-label {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.hearts-rival.is-taking-trick .durak-player-label,
.hearts-player.is-taking-trick .durak-player-label {
	box-shadow: 0 0 0 3px rgba(255, 225, 91, .92), 0 7px 18px rgba(0, 0, 0, .24);
}

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

.hearts-trick-card--1 {
	left: 0;
	top: 50%;
	transform: translateY(-50%) rotate(-4deg);
}

.hearts-trick-card--2 {
	left: 50%;
	top: 0;
	transform: translateX(-50%);
}

.hearts-trick-card--3 {
	right: 0;
	top: 50%;
	transform: translateY(-50%) rotate(4deg);
}

.hearts-round-result {
	position: absolute;
	z-index: 8;
	inset: 7% 2%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 12px 15px;
	border-radius: 5px;
	color: #193522;
	text-align: center;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.hearts-round-result strong {
	margin-bottom: 6px;
	font-size: 17px;
}

.hearts-round-result span {
	font-size: 12px;
	line-height: 1.45;
}

.hearts-round {
	z-index: 6;
	left: 50%;
	top: calc(43% + var(--card-height));
	max-width: 56%;
	padding: 3px 9px;
	border-radius: 12px;
	color: rgba(255, 255, 255, .8);
	font-size: 11px;
	white-space: nowrap;
	background: rgba(19, 73, 29, .55);
	transform: translateX(-50%);
}

.hearts-message {
	z-index: 7;
	left: 12%;
	right: 12%;
	bottom: calc(var(--card-height) + 53px);
	height: 22px;
	padding: 0;
}

.hearts-actions {
	z-index: 9;
	left: 14%;
	right: 14%;
	bottom: calc(var(--card-height) + 7px);
	height: 43px;
}

.hearts-actions button:disabled {
	opacity: .55;
	cursor: default;
}

.hearts-player {
	z-index: 8;
	left: 12px;
	right: 12px;
	bottom: 5px;
	height: var(--card-height);
}

.hearts-player .durak-hand {
	width: min(920px, calc(100% - 180px));
}

.hearts-player .durak-card.is-selectable {
	cursor: pointer;
}

.hearts-player .durak-card.is-selected {
	z-index: 9;
	transform: translateY(-13px);
	box-shadow: 0 0 0 3px #ffdf54, 0 9px 14px rgba(0, 0, 0, .3);
}

.hearts-player .durak-card.is-selected:hover,
.hearts-player .durak-card.is-selected:focus-visible {
	transform: translateY(-15px);
}

.hearts-player .durak-card.is-playable:not(.is-selected) {
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .42), 0 1px 2px rgba(0, 0, 0, .24);
}

.hearts-page .durak-overlay__cards {
	color: #2d7e3e;
	letter-spacing: 2px;
}

.hearts-card-flight {
	position: fixed !important;
	z-index: 1000 !important;
	margin: 0 !important;
	pointer-events: none !important;
}

@media (max-width: 900px) {
	.hearts-rival .durak-player-label {
		display: grid;
		min-width: 112px;
		grid-template-columns: 28px auto;
		column-gap: 5px;
		padding: 4px 7px 4px 5px;
	}

	.hearts-rival .durak-player-label__avatar {
		width: 27px;
		height: 27px;
	}

	.hearts-rival--top .durak-player-label {
		left: calc(-112px - 7px);
	}

	.hearts-rival--left .durak-player-label,
	.hearts-rival--right .durak-player-label {
		display: none;
	}

	.hearts-player .durak-hand {
		width: calc(100% - 12px);
	}

	.hearts-message {
		left: 4%;
		right: 4%;
	}
}

@media (max-width: 680px) {
	.hearts-broken-state {
		top: 5px;
		right: 5px;
		min-height: 28px;
		padding: 4px 7px;
		font-size: 10px;
	}

	.hearts-broken-state svg {
		width: 18px;
		height: 18px;
	}

	.hearts-rival--top {
		width: 62vw;
	}

	.hearts-rival--top .durak-player-label {
		display: none;
	}

	.hearts-rival--left {
		left: 3px;
	}

	.hearts-rival--right {
		right: 3px;
	}

	.hearts-rival--left,
	.hearts-rival--right {
		top: 45%;
		height: min(185px, calc(100% - var(--card-height) * 2 - 95px));
	}

	.hearts-table {
		top: 42%;
		width: calc(var(--card-width) * 3.2);
		height: calc(var(--card-height) * 2.25);
	}

	.hearts-round {
		top: calc(42% + var(--card-height));
		max-width: 78%;
		font-size: 10px;
	}

	.hearts-message {
		bottom: calc(var(--card-height) + 45px);
		font-size: 10px;
	}

	.hearts-actions {
		bottom: calc(var(--card-height) + 3px);
		height: 39px;
	}

	.hearts-player {
		left: 2px;
		right: 2px;
		bottom: 3px;
	}
}

@media (max-height: 620px) and (min-width: 681px) {
	.hearts-rival--left,
	.hearts-rival--right {
		height: 180px;
	}

	.hearts-table {
		top: 41%;
		height: calc(var(--card-height) * 2.15);
	}

	.hearts-round {
		top: calc(41% + var(--card-height) * 1.2);
	}

	.hearts-message {
		bottom: calc(var(--card-height) + 48px);
	}

	.hearts-actions {
		bottom: calc(var(--card-height) + 4px);
	}
}

@media (max-height: 500px) {
	.hearts-broken-state span {
		display: none;
	}

	.hearts-broken-state {
		padding: 4px;
	}

	.hearts-rival--left,
	.hearts-rival--right {
		height: 135px;
	}

	.hearts-table {
		top: 39%;
		height: calc(var(--card-height) * 2.02);
	}

	.hearts-round {
		display: none;
	}

	.hearts-message {
		bottom: calc(var(--card-height) + 41px);
	}

	.hearts-actions {
		bottom: calc(var(--card-height) + 1px);
		height: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hearts-player .durak-card.is-selected {
		transition: none;
	}

	.hearts-broken-state,
	.hearts-broken-state *,
	.hearts-take-label {
		transition: none;
	}
}
