:root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
	color: #f5eee4;
	background: #171614;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

button {
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

button:focus-visible {
	outline: 2px solid #dfbb82;
	outline-offset: 4px;
}

button:disabled {
	opacity: .35;
	cursor: default;
}

[hidden] {
	display: none !important;
}

.app {
	position: fixed;
	inset: 0;
	background: #171614;
}

#viewer {
	position: absolute;
	inset: 0;
	touch-action: none;
}

.status {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(360px, calc(100% - 48px));
	padding: 24px;
	text-align: center;
	background: #23211ef2;
	border: 1px solid #ffffff15;
	border-radius: 16px;
}

.status p {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.status button,
.notice button {
	border: 1px solid #c1aa8866;
	background: #c1aa881a;
	color: #f5eee4;
	border-radius: 8px;
	padding: 9px 16px;
}

.status button {
	margin-top: 18px;
	min-height: 44px;
}

.spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 2px solid #ffffff26;
	border-top-color: #d7b581;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.notice {
	position: absolute;
	left: 50%;
	top: calc(100px + env(safe-area-inset-top, 0px));
	transform: translateX(-50%);
	max-width: calc(100% - 32px);
	display: flex;
	align-items: center;
	gap: 12px;
	white-space: nowrap;
	padding: 8px 12px;
	background: #23211ef2;
	border-radius: 12px;
	font-size: 13px;
}

.footer {
	position: absolute;
	right: calc(12px + env(safe-area-inset-right, 0px));
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
	line-height: 0;
}

.toolbar {
	user-select: none;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 3px 5px;
	background: #2c2925d9;
	border: 1px solid #c1aa8833;
	border-radius: 999px;
	pointer-events: auto;
	box-shadow: 0 2px 12px #0003;
}

.toolbar button {
	border: 0;
	color: #f5eee4;
	background: transparent;
	min-width: 36px;
	height: 32px;
	border-radius: 999px;
	font-size: 22px;
}

.toolbar button:active:not(:disabled) {
	background: #ffffff10;
}

.toolbar .text-button {
	font-size: 12px;
	padding: 0 9px;
}

.divider {
	width: 1px;
	height: 12px;
	background: #ffffff1f;
}

.fullscreen {
	margin-left: 2px;
}

.app.is-landscape .footer {
	left: calc(12px + env(safe-area-inset-left, 0px));
	right: auto;
	width: max-content;
	transform-origin: left bottom;
	transform: rotate(90deg) translateX(-100%);
}

.app.is-fullscreen> :not(#viewer):not(.footer) {
	display: none !important;
}

.app.is-fullscreen .toolbar> :not(.close-fullscreen):not(.orientation-toggle) {
	display: none !important;
}

.toolbar .close-fullscreen {
	font-size: 24px;
	padding: 0;
	line-height: 1;
}

.noscript {
	position: absolute;
	top: 40%;
	width: 100%;
	text-align: center;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.spinner {
		animation: none;
	}
}