.cubby-loading-screen {
	position: fixed;
	inset: 0;
	z-index: 60;
	box-sizing: border-box;
	display: flex;
	min-height: 100vh;
	min-height: 100dvh;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.875rem;
	padding: 1.5rem;
	background-color: var(--color-base-100, #f7f4ed);
	color: #5a5f55;
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	text-align: center;
}

/* The dark theme: the splash's text is the one written-out colour here. */
[data-color-scheme='dark'] .cubby-loading-screen {
	color: #b4bba8;
}

.cubby-loading-screen.cubby-loading-content {
	position: static;
	inset: auto;
	z-index: auto;
	width: 100%;
	min-height: min(50dvh, 30rem);
	background-color: transparent;
}

.cubby-loading-art {
	box-sizing: border-box;
	display: grid;
	width: 6rem;
	height: 6rem;
	place-items: center;
	overflow: hidden;
	border: 1px solid var(--color-base-300, #d7cabc);
	border-radius: 1.5rem;
	background-color: var(--color-base-50, #fefcf8);
}

.cubby-loading-corgi {
	display: block;
	width: 4.5rem;
	height: 4.5rem;
	object-fit: contain;
	transform-origin: 50% 85%;
	user-select: none;
	animation: cubby-corgi-breathe 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.cubby-loading-message {
	max-width: 16rem;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.cubby-boot-notice {
	display: flex;
	max-width: 20rem;
	flex-direction: column;
	align-items: center;
	gap: 0.375rem;
}

.cubby-boot-notice[hidden] {
	display: none;
}

.cubby-boot-title {
	margin: 0;
	color: var(--color-base-content, #1f2a22);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.5rem;
}

.cubby-boot-text {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.375rem;
}

.cubby-boot-details {
	max-width: 100%;
	margin-top: 0.25rem;
	font-size: 0.8125rem;
}

.cubby-boot-details[hidden] {
	display: none;
}

.cubby-boot-details summary {
	min-height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

/* A semibold trigger with a caret, not an underline (no underlined links): the caret
   points down while closed and up once open, in the text's own colour in either theme. */
.cubby-boot-details summary::-webkit-details-marker {
	display: none;
}

.cubby-boot-details summary::after {
	content: '';
	width: 0.4375rem;
	height: 0.4375rem;
	margin-top: -0.1875rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.cubby-boot-details[open] summary::after {
	margin-top: 0.1875rem;
	transform: rotate(225deg);
}

.cubby-boot-detail {
	max-width: 100%;
	margin: 0.25rem 0 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.75rem;
	line-height: 1.125rem;
	overflow-wrap: anywhere;
}

.cubby-boot-reload {
	min-width: 8rem;
	min-height: 2.75rem;
	margin-top: 0.75rem;
	padding: 0 1.25rem;
	border: 0;
	border-radius: 999px;
	background-color: var(--color-primary, #22701c);
	color: var(--color-primary-content, #f7f6f1);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

.cubby-boot-reload:focus-visible {
	outline: 2px solid var(--color-primary, #22701c);
	outline-offset: 3px;
}

#cubby-splash[data-boot-state='failed'] .cubby-boot-title {
	color: var(--color-error, #ab413a);
}

/* A failed start is not loading any more, so the splash stops saying it is. */
#cubby-splash[data-boot-state='failed'] .cubby-loading-message {
	display: none;
}

#cubby-splash[data-boot-state='failed'] .cubby-loading-corgi {
	animation: none;
}

@keyframes cubby-corgi-breathe {
	0%,
	100% {
		transform: translateY(0) scale(1);
	}

	50% {
		transform: translateY(-2px) scale(1.015);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cubby-loading-corgi {
		animation: none;
	}
}
