.pixel-test-panel {
	margin: 0.75rem 0 1.5rem;
}

.pixel-test-start {
	display: inline-block;
	padding: 0.9rem 1.35rem;
	border: 2px solid var(--btn-border, #111);
	border-radius: 10px;
	background: var(--btn-bg, #111);
	color: var(--btn-fg, #fff);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
}

.pixel-test-start:hover {
	background: #303030;
	color: #fff;
}

.pixel-test-instructions {
	margin: 1rem 0 0.5rem;
	font-size: 0.97rem;
}

.pixel-test-keys {
	font-size: 0.9rem;
	margin-bottom: 0;
}

/* The same isolated element is used for native and browser-only fullscreen. */
.pixel-test-screen {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	width: 100%;
	height: 100%;
	height: 100dvh;
	margin: 0;
	padding: 0;
	background: #000;
	background-image: none;
	color: #fff;
	outline: none;
	overscroll-behavior: contain;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.pixel-test-screen[hidden] {
	display: none !important;
}

.pixel-test-screen:fullscreen,
.pixel-test-screen:-webkit-full-screen {
	width: 100%;
	height: 100%;
}

.pixel-test-screen::backdrop {
	background: #000;
}

html.pixel-test-active,
html.pixel-test-active body {
	overflow: hidden;
	overscroll-behavior: none;
}

.pixel-test-toolbar,
.pixel-test-hint {
	position: absolute;
	z-index: 1;
	background: rgba(20, 20, 20, 0.94);
	color: #fff;
	border-radius: 10px;
	padding: 0.5rem;
	font-family: inherit;
	font-size: 0.875rem;
	line-height: 1.4;
}

.pixel-test-toolbar {
	top: max(0.75rem, env(safe-area-inset-top));
	inset-inline-end: max(0.75rem, env(safe-area-inset-right));
	display: flex;
	align-items: center;
	gap: 0.4rem;
	max-width: calc(100% - 1.5rem);
}

.pixel-test-toolbar button,
.pixel-test-toolbar a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0.4rem 0.6rem;
	border: 1px solid #a9a9a9;
	border-radius: 6px;
	background: #252525;
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.pixel-test-toolbar button:hover,
.pixel-test-toolbar a:hover {
	background: #4a4a4a;
	color: #fff;
}

.pixel-test-toolbar button:focus-visible,
.pixel-test-toolbar a:focus-visible {
	outline: 3px solid #8ecbff;
	outline-offset: 2px;
}

.pixel-test-toolbar button:disabled {
	opacity: 0.4;
	cursor: default;
}

.pixel-test-progress {
	min-width: 5rem;
	text-align: center;
}

.pixel-test-hint {
	bottom: max(0.75rem, env(safe-area-inset-bottom));
	inset-inline-start: max(0.75rem, env(safe-area-inset-left));
	max-width: min(44rem, calc(100% - 1.5rem));
	pointer-events: none;
}

.pixel-test-hint p {
	margin: 0;
}

.pixel-test-hint [hidden] {
	display: none;
}

.pixel-test-screen.pixel-test-ui-hidden [data-pixel-toolbar] {
	opacity: 0;
	pointer-events: none;
}

.pixel-test-screen.pixel-test-ui-hidden {
	cursor: none;
}

@media (max-width: 640px) {
	.pixel-test-start {
		width: 100%;
		box-sizing: border-box;
		font-size: 1rem;
	}

	.pixel-test-toolbar {
		inset-inline: 0.5rem;
		top: max(0.5rem, env(safe-area-inset-top));
		max-width: none;
		gap: 0.25rem;
		padding: 0.35rem;
		font-size: 0.8rem;
		flex-wrap: wrap;
	}

	.pixel-test-progress {
		min-width: 0;
		flex: 1;
		overflow-wrap: anywhere;
	}

	.pixel-test-toolbar .pixel-test-finish {
		flex: 1;
	}
}
