/* The photo editor's Back arrow, its "leave without saving?" box, and arriving/leaving animations
   (17 October 2026). Kept outside the miniPaint build (photo-editor/), so no rebuild is needed.
   The same moves as the Builder (assets/builder/builder.css). */

/* Back: a quiet pill at the very top left, before the Splash mark */
body.theme-splash .splash_back {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	margin: 0 6px 0 0;
	padding: 0 16px 0 11px;
	border-radius: 999px;
	background: #2a2b2d;
	color: #f9f9f9;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, box-shadow .15s;
}
body.theme-splash .splash_back svg {
	width: 20px;
	height: 20px;
	transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
body.theme-splash .splash_back:hover {
	background: #3a3b3d;
	box-shadow: inset 0 0 0 1px #c6ff3d66;
}
body.theme-splash .splash_back:hover svg {
	transform: translateX(-2px);
}
/* Narrower headers: the arrow on its own (the label is still its name for screen readers) */
@media screen and (min-width: 701px) {
	@container splash_head (max-width: 1180px) {
		body.theme-splash .splash_back {
			width: 40px;
			padding: 0;
			justify-content: center;
		}
		body.theme-splash .splash_back span {
			display: none;
		}
	}
}
/* Phones: in the compact bar, before the mark */
@media screen and (max-width: 700px) {
	body.theme-splash .submenu > .splash_back {
		width: 36px;
		height: 36px;
		padding: 0;
		margin: 0 4px 0 2px;
		justify-content: center;
	}
	body.theme-splash .submenu > .splash_back span {
		display: none;
	}
}
/* On the welcome screen too, so there is always a way back */
.splash_welcome .splash_back_float {
	position: absolute;
	top: 12px;
	left: 16px;
}

/* "Leave without saving?" */
.splash_leave {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: grid;
	place-items: center;
	padding: 16px;
	background: #0009;
	backdrop-filter: blur(4px);
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	animation: splashFade .18s ease;
}
.splash_leave_box {
	width: min(100%, 440px);
	box-sizing: border-box;
	padding: 26px;
	border-radius: 20px;
	background: #18191b;
	border: 1px solid #2c2d2f;
	box-shadow: 0 34px 90px #0009;
	color: #f9f9f9;
	animation: splashDlg .26s cubic-bezier(.2, .8, .2, 1);
}
.splash_leave_box img {
	width: 40px;
	height: 40px;
}
.splash_leave_box h2 {
	margin: 12px 0 8px;
	font-size: 21px;
	font-weight: 650;
}
.splash_leave_box p {
	margin: 0;
	color: #c9c9cb;
	line-height: 1.5;
}
.splash_leave_btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}
.splash_leave_btns button {
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: #2a2b2d;
	color: #f9f9f9;
	font: 600 14px 'Plus Jakarta Sans', system-ui, sans-serif;
	cursor: pointer;
}
.splash_leave_btns button:hover {
	background: #3a3b3d;
}
.splash_leave_btns .splash_leave_go {
	background: #c6ff3d;
	color: #101408;
}
.splash_leave_btns .splash_leave_go:hover {
	background: #d4ff6a;
}

/* Arriving: the header drops in, tools from the left, panels from the right, the canvas rises;
   on the welcome screen the mark, words and cards rise one after another. Leaving runs it backwards. */
@media (prefers-reduced-motion: no-preference) {
	body.splash_enter .main_menu,
	body.splash_enter .submenu {
		animation: splashDrop .42s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .sidebar_left {
		animation: splashFromLeft .46s .06s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .middle_area {
		animation: splashRise .55s .12s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .sidebar_right {
		animation: splashFromRight .46s .1s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .splash_welcome_inner > * {
		animation: splashRise .5s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .splash_welcome_inner > :nth-child(2) { animation-delay: .06s; }
	body.splash_enter .splash_welcome_inner > :nth-child(3) { animation-delay: .1s; }
	body.splash_enter .splash_welcome_cards > *,
	body.splash_enter .splash_welcome_size_list > * {
		animation: splashRise .45s cubic-bezier(.2, .8, .2, 1) both;
	}
	body.splash_enter .splash_welcome_cards > :nth-child(1) { animation-delay: .14s; }
	body.splash_enter .splash_welcome_cards > :nth-child(2) { animation-delay: .19s; }
	body.splash_enter .splash_welcome_cards > :nth-child(3) { animation-delay: .24s; }
	body.splash_enter .splash_welcome_cards > :nth-child(4) { animation-delay: .29s; }
	body.splash_enter .splash_welcome_cards > :nth-child(5) { animation-delay: .34s; }
	body.splash_enter .splash_welcome_cards > :nth-child(6) { animation-delay: .39s; }
	body.splash_enter .splash_welcome_mark {
		border-radius: 50%;
		animation: splashRise .5s cubic-bezier(.2, .8, .2, 1) both, splashHello 1.4s .45s ease-out both;
	}

	body.splash_leaving .main_menu,
	body.splash_leaving .submenu { animation: splashDrop .2s ease-in reverse both; }
	body.splash_leaving .sidebar_left { animation: splashFromLeft .2s ease-in reverse both; }
	body.splash_leaving .middle_area,
	body.splash_leaving .splash_welcome_inner { animation: splashRise .2s ease-in reverse both; }
	body.splash_leaving .sidebar_right,
	body.splash_leaving #sai.sai-docked .sai-win { animation: splashFromRight .2s ease-in reverse both; }
}
@keyframes splashDrop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes splashFromLeft { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes splashFromRight { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes splashRise { from { opacity: 0; transform: scale(.985) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes splashHello { 0% { box-shadow: 0 0 0 0 #c6ff3d00; } 25% { box-shadow: 0 0 0 10px #c6ff3d40; } 100% { box-shadow: 0 0 0 22px #c6ff3d00; } }
@keyframes splashFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashDlg { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
