* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background:
		radial-gradient(circle at 20% -10%, #fff5e8 0%, rgba(255, 245, 232, 0) 45%),
		radial-gradient(circle at 90% 12%, #ffdcb4 0%, rgba(255, 220, 180, 0) 38%),
		linear-gradient(180deg, #fff5e7 0%, #ffe9cb 45%, #ffd8aa 100%);
	color: #4e3414;
	display: grid;
	place-items: center;
	padding: 28px;
	position: relative;
	overflow-x: hidden;
}

body::before,
body::after {
	content: "";
	position: fixed;
	border-radius: 999px;
	filter: blur(6px);
	z-index: -1;
}

body::before {
	width: 320px;
	height: 320px;
	left: -70px;
	top: -60px;
	background: radial-gradient(circle, rgba(255, 195, 120, 0.5), rgba(255, 195, 120, 0));
}

body::after {
	width: 300px;
	height: 300px;
	right: -60px;
	bottom: -70px;
	background: radial-gradient(circle, rgba(153, 190, 90, 0.28), rgba(153, 190, 90, 0));
}

.app {
	width: min(960px, 100%);
	display: grid;
	gap: 20px;
}

.card,
.counter-section {
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(255, 246, 233, 0.72));
	border: 1px solid rgba(255, 255, 255, 0.95);
	border-radius: 26px;
	box-shadow:
		0 16px 38px rgba(78, 52, 20, 0.13),
		inset 0 1px 0 rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(5px);
}

.card {
	padding: 20px 20px 18px;
	text-align: center;
	position: relative;
}

.visual-grid {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 14px;
	align-items: stretch;
}

.olive-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 18px;
	box-shadow:
		0 14px 30px rgba(0, 0, 0, 0.1),
		0 0 0 6px rgba(255, 255, 255, 0.26);
}

.photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 18px;
	box-shadow:
		0 14px 30px rgba(0, 0, 0, 0.1),
		0 0 0 6px rgba(255, 255, 255, 0.22);
}

.caption {
	margin: 16px auto 4px;
	line-height: 1.5;
	font-size: 1.03rem;
	font-weight: 500;
	max-width: 62ch;
}

.counter-section {
	position: relative;
	overflow: hidden;
	min-height: 250px;
	padding: 22px;
	display: grid;
	align-content: start;
	gap: 16px;
}

.counter-section::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 12% -10%, rgba(255, 181, 100, 0.3), transparent 45%),
		radial-gradient(circle at 85% 108%, rgba(132, 168, 78, 0.22), transparent 45%);
	pointer-events: none;
}

.start-button {
	justify-self: auto;
	border: 0;
	border-radius: 999px;
	height: 48px;
	font-size: 1.02rem;
	font-weight: 700;
	color: #ffffff;
	background: linear-gradient(130deg, #ffb064, #ff8834 58%, #ea6f20);
	padding: 0 30px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	box-shadow:
		0 10px 26px rgba(255, 127, 51, 0.38),
		inset 0 -2px 6px rgba(0, 0, 0, 0.1);
	z-index: 1;
}

.counter-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-wrap: nowrap;
	z-index: 1;
}

.start-button:disabled {
	cursor: not-allowed;
	opacity: 0.75;
}

.counter-wrap {
	text-align: center;
	z-index: 1;
	flex: 0 1 auto;
}

.counter-text {
	margin: 0;
	font-size: clamp(1.1rem, 1rem + 0.85vw, 1.5rem);
	font-weight: 700;
	color: #7e4510;
	min-height: 48px;
	padding: 0 18px;
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.95);
	box-shadow: 0 8px 16px rgba(126, 69, 16, 0.08);
}

.emoji-field {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.heart {
	position: absolute;
	font-size: clamp(1.1rem, 2vw, 1.7rem);
	opacity: 0;
	animation: floatHeart 2.8s ease-in forwards;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

@keyframes floatHeart {
	0% {
		transform: translate3d(0, 12px, 0) scale(0.75) rotate(0deg);
		opacity: 0;
	}
	20% {
		opacity: 1;
	}
	100% {
		transform: translate3d(var(--drift), -220px, 0) scale(1.15) rotate(var(--spin));
		opacity: 0;
	}
}

@media (max-width: 640px) {
	body {
		padding: 16px;
	}

	.card,
	.counter-section {
		border-radius: 20px;
	}

	.counter-section {
		min-height: 270px;
		padding: 16px;
	}

	.visual-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.counter-controls {
		flex-direction: column;
		gap: 10px;
	}

	.start-button {
		width: min(100%, 260px);
	}

	.caption {
		font-size: 0.96rem;
	}
}
