body.kv-game-lock-scroll {
	overflow: hidden;
	touch-action: none;
}

.kv-game {
	color: #ffffff;
	margin: 0 auto;
	max-width: 1180px;
	width: 100%;
}

.kv-game-shell {
	background: #050505;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: min(900px, calc(100vh - 130px));
	min-height: 620px;
	overflow: hidden;
	padding: 14px;
	position: relative;
}

.kv-game-shell.is-fullscreen,
.kv-game-shell:fullscreen,
.kv-game-shell:-webkit-full-screen {
	border: 0;
	border-radius: 0;
	height: 100vh;
	height: 100dvh;
	inset: 0;
	max-width: none;
	padding:
		max(10px, env(safe-area-inset-top))
		max(10px, env(safe-area-inset-right))
		max(10px, env(safe-area-inset-bottom))
		max(10px, env(safe-area-inset-left));
	position: fixed;
	width: 100vw;
	z-index: 999999;
}

.kv-game-header {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	gap: 14px;
	justify-content: space-between;
	min-height: 58px;
}

.kv-game-kicker {
	color: #ff4a51;
	font-size: 0.75rem;
	font-weight: 900;
	margin: 0 0 3px;
	text-transform: uppercase;
}

.kv-game-header h2 {
	color: #ffffff;
	font-size: clamp(1.35rem, 3vw, 2rem);
	line-height: 1.05;
	margin: 0;
}

.kv-game-header__actions,
.kv-game-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.kv-game-header button,
.kv-game-overlay button,
.kv-game-overlay a,
.kv-game-control-btn {
	align-items: center;
	background: #d71920;
	border: 0;
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 900;
	justify-content: center;
	min-height: 42px;
	padding: 10px 14px;
	text-decoration: none;
	touch-action: none;
}

.kv-game-header button:hover,
.kv-game-header button:focus,
.kv-game-overlay button:hover,
.kv-game-overlay button:focus,
.kv-game-overlay a:hover,
.kv-game-overlay a:focus,
.kv-game-control-btn:hover,
.kv-game-control-btn:focus {
	background: #a80f15;
	color: #ffffff;
	outline: none;
}

.kv-game-topbar {
	display: grid;
	flex: 0 0 auto;
	gap: 8px;
	grid-template-columns: repeat(8, minmax(0, 1fr));
}

.kv-game-topbar div {
	background: #151515;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	min-width: 0;
	padding: 8px 9px;
}

.kv-game-topbar span {
	color: #cfcfcf;
	display: block;
	font-size: 0.68rem;
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
}

.kv-game-topbar strong {
	color: #ffffff;
	display: block;
	font-size: clamp(0.95rem, 1.8vw, 1.25rem);
	line-height: 1.1;
	margin-top: 3px;
	overflow-wrap: anywhere;
}

.kv-game-stage-wrap {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
		#101010;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	flex: 1 1 auto;
	min-height: 360px;
	overflow: hidden;
	position: relative;
	touch-action: none;
}

.kv-game-canvas {
	display: block;
	height: 100%;
	width: 100%;
}

.kv-game-task {
	background: rgba(5, 5, 5, 0.86);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-left: 5px solid #d71920;
	border-radius: 8px;
	color: #ffffff;
	font-weight: 900;
	left: 10px;
	line-height: 1.2;
	max-width: calc(100% - 20px);
	padding: 10px 12px;
	position: absolute;
	right: auto;
	top: 10px;
	z-index: 3;
}

.kv-game-overlay {
	align-items: center;
	background: rgba(5, 5, 5, 0.92);
	display: none;
	flex-direction: column;
	inset: 0;
	justify-content: center;
	overflow: auto;
	padding: 22px;
	position: absolute;
	text-align: center;
	z-index: 5;
}

.kv-game-overlay.is-visible {
	display: flex;
}

.kv-game-overlay h3 {
	color: #ffffff;
	font-size: clamp(1.6rem, 4vw, 2.9rem);
	line-height: 1.05;
	margin: 0 0 12px;
}

.kv-game-overlay p {
	color: #eeeeee;
	margin: 0 0 12px;
	max-width: 620px;
}

.kv-game-results {
	background: rgba(255, 255, 255, 0.08);
	border-left: 5px solid #d71920;
	border-radius: 8px;
	margin-bottom: 12px;
	max-height: min(330px, 46vh);
	overflow: auto;
	padding: 13px;
	text-align: left;
	width: min(100%, 420px);
}

.kv-game-results p {
	margin: 6px 0;
}

.kv-game-nickname {
	display: grid;
	gap: 6px;
	margin-bottom: 12px;
	width: min(100%, 360px);
}

.kv-game-nickname span {
	font-weight: 900;
}

.kv-game-nickname input {
	border: 0;
	border-radius: 8px;
	font: inherit;
	min-height: 42px;
	padding: 10px 12px;
}

.kv-game-mobile-controls {
	display: grid;
	flex: 0 0 auto;
	gap: 8px;
	grid-template-columns: repeat(5, minmax(44px, 64px));
	justify-content: center;
	padding-bottom: 2px;
	touch-action: none;
}

.kv-game-control-btn {
	aspect-ratio: 1 / 1;
	font-size: 1.1rem;
	height: 52px;
	min-height: 0;
	padding: 0;
	width: 100%;
}

.kv-game-control-btn--boost {
	aspect-ratio: auto;
	background: #ffffff;
	color: #111111;
	font-size: 0.78rem;
	min-width: 72px;
}

.kv-game-control-btn--boost:hover,
.kv-game-control-btn--boost:focus {
	background: #f1f1f1;
	color: #111111;
}

.kv-game [hidden] {
	display: none !important;
}

.kv-game-scores {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 24px auto 0;
	max-width: 1180px;
}

.kv-game-scores section {
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	color: #111111;
	padding: 18px;
}

.kv-game-scores h3 {
	margin: 0 0 12px;
}

.kv-game-scores table {
	border-collapse: collapse;
	width: 100%;
}

.kv-game-scores th,
.kv-game-scores td {
	border-bottom: 1px solid #eeeeee;
	font-size: 0.94rem;
	padding: 8px 6px;
	text-align: left;
	vertical-align: top;
}

@media (max-width: 980px) {
	.kv-game-topbar {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.kv-game-scores {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.kv-game {
		margin-left: -18px;
		margin-right: -18px;
		width: auto;
	}

	.kv-game-shell {
		border-left: 0;
		border-radius: 0;
		border-right: 0;
		gap: 8px;
		height: clamp(560px, calc(100dvh - 170px), 760px);
		min-height: 560px;
		padding: 10px;
	}

	.kv-game-header {
		min-height: 44px;
	}

	.kv-game-header h2 {
		font-size: 1.2rem;
	}

	.kv-game-kicker {
		font-size: 0.66rem;
	}

	.kv-game-header button {
		min-height: 34px;
		padding: 7px 9px;
	}

	.kv-game-topbar {
		gap: 5px;
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.kv-game-topbar div {
		border-radius: 6px;
		padding: 6px;
	}

	.kv-game-topbar span {
		font-size: 0.6rem;
	}

	.kv-game-topbar strong {
		font-size: 0.95rem;
	}

	.kv-game-stage-wrap {
		min-height: 330px;
	}

	.kv-game-task {
		font-size: 0.9rem;
		left: 8px;
		padding: 8px 10px;
		top: 8px;
	}

	.kv-game-overlay {
		padding: 16px;
	}

	.kv-game-overlay h3 {
		font-size: 1.65rem;
	}

	.kv-game-overlay p {
		font-size: 0.92rem;
	}

	.kv-game-mobile-controls {
		gap: 6px;
		grid-template-columns: repeat(5, minmax(40px, 54px));
	}

	.kv-game-control-btn {
		font-size: 1rem;
		height: 44px;
	}

	.kv-game-control-btn--boost {
		font-size: 0.68rem;
		min-width: 58px;
	}

	.kv-game-scores {
		margin-left: -18px;
		margin-right: -18px;
	}

	.kv-game-scores section {
		border-radius: 0;
	}
}

@media (max-height: 720px) {
	.kv-game-shell {
		gap: 7px;
		height: clamp(480px, calc(100dvh - 120px), 620px);
		min-height: 480px;
		padding: 8px;
	}

	.kv-game-header {
		min-height: 38px;
	}

	.kv-game-kicker {
		display: none;
	}

	.kv-game-header h2 {
		font-size: 1.1rem;
	}

	.kv-game-topbar div {
		padding: 5px 6px;
	}

	.kv-game-stage-wrap {
		min-height: 260px;
	}

	.kv-game-control-btn {
		height: 40px;
	}
}
