:root {
	color-scheme: dark;
}

[hidden] {
	display: none !important;
}

html,
body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
	/* Pinch zoom stays possible; double-tap zoom would swallow the triple tap. */
	touch-action: manipulation;
	background: #000;
	color: #fefefe;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.unlock {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	padding: 180px 16px 0;
}

.unlock input,
.unlock button {
	font: inherit;
	font-size: 1.2rem;
	padding: 4px 10px;
}

.unlock input {
	width: 16rem;
	max-width: 100%;
	min-width: 0;
}

.message {
	flex-basis: 100%;
	min-height: 1.5em;
	margin: 0;
	text-align: center;
	color: #bbb;
}

.stage {
	position: fixed;
	inset: 0;
}

.media {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	object-fit: contain;
}

.loading {
	position: fixed;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: rgba(255, 255, 255, 0.7);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.filters {
	position: fixed;
	top: max(12px, env(safe-area-inset-top));
	left: max(12px, env(safe-area-inset-left));
	z-index: 10;
	display: flex;
	gap: 4px;
	opacity: 0.6;
}

.filters button {
	height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: 16px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font: 600 13px system-ui, sans-serif;
	cursor: pointer;
}

.filters button.active {
	background: rgba(255, 255, 255, 0.85);
	color: #000;
}

.controls {
	position: fixed;
	top: max(12px, env(safe-area-inset-top));
	right: max(12px, env(safe-area-inset-right));
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 8px;
	opacity: 0.6;
}

.counter {
	text-align: right;
	font-size: 13px;
	line-height: 18px;
	font-variant-numeric: tabular-nums;
}

.controls button {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font: 600 12px system-ui, sans-serif;
	cursor: pointer;
}

.controls button:hover {
	background: rgba(0, 0, 0, 0.7);
}

.controls button:disabled {
	opacity: 0.4;
}

.controls svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.controls .playing svg {
	display: none;
}

.error {
	position: fixed;
	right: 16px;
	bottom: max(24px, env(safe-area-inset-bottom));
	left: 16px;
	text-align: center;
	color: #ff6b6b;
}

body.is-hidden .stage,
body.is-hidden .loading,
body.is-hidden .filters,
body.is-hidden .controls,
body.is-hidden .error {
	visibility: hidden;
}
