:root {
	--surface: rgba(255, 255, 255, 0.85);
	--border: rgba(15, 23, 42, 0.15);
	--ink: #0b132b;
	--accent: #ff6cd9;
	--gradient: radial-gradient(circle at 20% 20%, #4d2cda, transparent 60%),
		radial-gradient(circle at 80% 0%, #ff8e4d, transparent 50%),
		radial-gradient(circle at 10% 80%, #00c6ff, transparent 55%),
		radial-gradient(circle at 90% 90%, #f72585, transparent 65%),
		linear-gradient(135deg, #050714, #111237);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	min-height: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
	background-color: #050714;
	background-image: var(--gradient);
	color: var(--ink);
	overflow: hidden;
}

.app-shell {
	position: relative;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	padding: 0;
}

.toolbar {
	position: absolute;
	top: clamp(0.5rem, 1.5vw, 0.9rem);
	left: clamp(0.5rem, 1.5vw, 0.9rem);
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.55rem;
	padding: 0.45rem 0.55rem;
	background: rgba(255, 255, 255, 0.64);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
	backdrop-filter: blur(14px);
	z-index: 10;
	max-width: calc(100vw - 1rem);
}

.toolbar-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

h1 {
	font-size: clamp(0.72rem, 1.7vw, 0.9rem);
	line-height: 1.1;
	margin: 0;
	color: #071224;
	font-weight: 600;
}

button {
	font: inherit;
	font-weight: 600;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 0.5rem 0.85rem;
	font-size: 0.78rem;
	line-height: 1;
	box-shadow: 0 6px 16px rgba(247, 37, 133, 0.26);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

#goBack {
	background: linear-gradient(180deg, #ff6b6b 0%, #e03131 100%);
	color: #fff;
	border: 2px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 8px 18px rgba(224, 49, 49, 0.32);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

#goBack:hover,
#goBack:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(224, 49, 49, 0.38);
	outline: 3px solid rgba(255, 107, 107, 0.3);
	outline-offset: 2px;
}

#goBack:active {
	transform: translateY(1px);
}

button:hover,
button:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(247, 37, 133, 0.34);
	outline: none;
}

button:active {
	transform: translateY(1px);
}

button:disabled {
	opacity: 0.6;
	cursor: progress;
	transform: none;
}

.canvas-wrap {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

#squishCanvas {
	position: relative;
	width: 100%;
	height: 100%;
	cursor: pointer;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 600ms ease;
}

.instruction {
	position: absolute;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.85rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	pointer-events: none;
	z-index: 2;
	animation: instruction-pulse 2s ease-in-out infinite;
	transition: opacity 400ms ease;
}

.instruction.hidden {
	opacity: 0;
}

.squishmallow {
	position: absolute;
	pointer-events: none;
	transform-origin: center center;
	animation: squish-pop 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	will-change: transform;
}

@keyframes squish-pop {
	0% {
		transform: translate(-50%, -50%) scale(0) rotate(-10deg);
		opacity: 0;
	}
	60% {
		transform: translate(-50%, -50%) scale(1.15) rotate(3deg);
		opacity: 1;
	}
	100% {
		transform: translate(-50%, -50%) scale(1) rotate(0deg);
		opacity: 1;
	}
}

@keyframes instruction-pulse {
	0%, 100% {
		opacity: 0.5;
	}
	50% {
		opacity: 1;
	}
}

@media (max-width: 560px) {
	h1 {
		font-size: 1.05rem;
	}

	button {
		flex: 1 1 auto;
		min-width: auto;
		padding: 0.45rem 0.65rem;
		font-size: 0.72rem;
	}

	.toolbar {
		border-radius: 1rem;
		gap: 0.4rem;
		flex-wrap: wrap;
		left: 0.5rem;
		max-width: calc(100vw - 1rem);
	}

	.toolbar-actions {
		gap: 0.35rem;
		flex-wrap: wrap;
	}

	.instruction {
		font-size: 0.75rem;
		bottom: 1rem;
	}
}
