.cheat-board {
	grid-template-rows:
		minmax(calc(var(--card-height) + 36px), .8fr)
		minmax(calc(var(--card-height) * 1.55), 2fr)
		minmax(62px, auto)
		48px
		minmax(var(--card-height), 1fr);
}

.cheat-opponent,
.cheat-player {
	overflow: visible;
}

.cheat-cpu-statement {
	position: absolute;
	top: 2px;
	right: 0;
	z-index: 6;
	max-width: 240px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 227, 148, .65);
	border-radius: 10px 10px 2px 10px;
	background: #194d29;
	color: #fff3be;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}

.cheat-opponent {
	padding-top: 36px;
}

.cheat-cpu-statement:empty,
.cheat-outcome:empty {
	display: none;
}

.cheat-messages {
	align-self: center;
	min-width: 0;
	padding: 4px 8px;
	text-align: center;
	line-height: 1.35;
}

.cheat-outcome {
	color: #fff3be;
	font-size: 12px;
	margin-bottom: 3px;
}

.cheat-page .cheat-message {
	padding: 0;
	white-space: normal;
	overflow: visible;
	font-size: 13px;
}

.cheat-play-area:has(.is-cheat-collecting),
.cheat-player:has(.is-cheat-collecting),
.cheat-opponent:has(.is-cheat-collecting) {
	z-index: 40;
}

.cheat-board .durak-card.is-cheat-collecting {
	z-index: 50 !important;
	animation: none;
	pointer-events: none;
}

.cheat-board .is-cheat-target {
	outline: 2px solid #ffdc79;
	outline-offset: 8px;
	border-radius: 8px;
	box-shadow: 0 0 24px rgba(255, 220, 121, .45);
}

.cheat-play-area {
	position: relative;
	display: grid;
	grid-template-columns: minmax(80px, .75fr) minmax(250px, 4fr) minmax(80px, .75fr);
	align-items: center;
	min-width: 0;
	min-height: 0;
}

.cheat-center,
.cheat-discard {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
}

.cheat-center {
	width: 100%;
	height: 100%;
}

.cheat-pile {
	position: relative;
	width: min(520px, 86%);
	height: calc(var(--card-height) * 1.34);
}

.cheat-pile__empty {
	position: absolute;
	inset: 20% 18%;
	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;
}

.cheat-pile .durak-card {
	position: absolute;
	left: 50%;
	top: 53%;
	transform: translate(-50%, -50%) rotate(var(--cheat-rotation, 0deg));
}

.cheat-pile .durak-card.is-revealed {
	z-index: 25 !important;
	animation: cheat-reveal .35s ease both;
}

.cheat-claim {
	position: absolute;
	z-index: 30;
	left: 50%;
	top: 3px;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 30px;
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 16px;
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
	background: rgba(19, 73, 29, .78);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
	transform: translateX(-50%);
}

.cheat-claim:empty {
	display: none;
}

.cheat-claim strong {
	color: #fff4ad;
}

.cheat-discard {
	height: 100%;
}

.cheat-discard .durak-card {
	position: absolute;
	transform: rotate(-7deg);
	opacity: .72;
}

.cheat-discard__count {
	position: absolute;
	z-index: 4;
	right: 8px;
	bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 27px;
	height: 27px;
	padding: 0 7px;
	border-radius: 14px;
	color: #184527;
	font-size: 12px;
	font-weight: 700;
	background: #fff;
	box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
}

.cheat-discard__label {
	position: absolute;
	left: 50%;
	bottom: 3px;
	color: rgba(255, 255, 255, .76);
	font-size: 11px;
	white-space: nowrap;
	transform: translateX(-50%);
}

.cheat-rules-note {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	justify-self: center;
	width: 76px;
	height: 58px;
	border: 1px solid rgba(255, 255, 255, .13);
	border-radius: 5px;
	color: rgba(255, 255, 255, .74);
	background: rgba(19, 73, 29, .5);
}

.cheat-rules-note strong {
	font-size: 20px;
	line-height: 1;
}

.cheat-rules-note span {
	margin-top: 4px;
	font-size: 10px;
}

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

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

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

.cheat-actions {
	gap: 6px;
	padding-inline: 8px;
}

.cheat-actions button {
	min-width: 98px;
	padding-inline: 14px;
}

.cheat-actions button[data-cheat-rank] {
	min-width: 42px;
	padding-inline: 10px;
}

.cheat-actions button[data-game-action="doubt"] {
	background: #7d2b31;
}

.cheat-actions button[data-game-action="doubt"]:hover,
.cheat-actions button[data-game-action="doubt"]:focus-visible {
	background: #681f25;
}

.cheat-actions button:disabled {
	opacity: .48;
	cursor: default;
}

.cheat-page .durak-overlay__cards {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-bottom: 10px;
	border: 3px solid #2d7e3e;
	border-radius: 50%;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 29px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
}

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

@keyframes cheat-reveal {
	0% { opacity: .2; transform: translate(-50%, -50%) rotate(var(--cheat-rotation, 0deg)) scaleX(.12); }
	100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--cheat-rotation, 0deg)) scaleX(1); }
}

@media (max-width: 680px) {
	.cheat-board {
		grid-template-rows:
			minmax(calc(var(--card-height) + 36px), .72fr)
			minmax(calc(var(--card-height) * 1.85), 2fr)
			minmax(82px, auto)
			42px
			minmax(var(--card-height), .9fr);
	}

	.cheat-play-area {
		grid-template-columns: 52px minmax(200px, 1fr) 48px;
	}

	.cheat-opponent {
		padding-top: 36px;
	}

	.cheat-cpu-statement {
		max-width: 62%;
		padding: 5px 8px;
		font-size: 11px;
	}

	.cheat-outcome,
	.cheat-page .cheat-message {
		font-size: 11px;
	}

	.cheat-pile {
		width: 96%;
	}

	.cheat-claim {
		top: 0;
		max-width: 92%;
		overflow: hidden;
		font-size: 10px;
		text-overflow: ellipsis;
	}

	.cheat-discard {
		transform: scale(.72);
	}

	.cheat-rules-note {
		width: 46px;
		height: 50px;
	}

	.cheat-rules-note span {
		display: none;
	}

	.cheat-actions {
		gap: 3px;
		padding-inline: 2px;
	}

	.cheat-actions button {
		min-width: 72px;
		height: 35px;
		padding-inline: 7px;
		font-size: 11px;
	}

	.cheat-actions button[data-cheat-rank] {
		min-width: 34px;
		padding-inline: 6px;
	}
}

@media (max-width: 390px) {
	.cheat-play-area {
		grid-template-columns: 42px minmax(205px, 1fr) 38px;
	}

	.cheat-rules-note {
		display: none;
	}

	.cheat-actions button[data-cheat-rank] {
		min-width: 31px;
		padding-inline: 4px;
	}
}

@media (max-height: 500px) {
	.cheat-rules-note {
		display: none;
	}

	.cheat-claim {
		top: -1px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cheat-player .durak-card,
	.cheat-pile .durak-card {
		animation: none;
		transition: none;
	}
}
