* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: #302e2b;
	font-family: "Mynerve", cursive;
	height: 100vh;
	overflow: hidden;
}

.scene {
	position: relative;
	width: 100vw;
	height: 56.25vw;
	max-height: 100vh;
	max-width: calc(100vh * 16 / 9);
	margin: 0 auto;
}

/* ─── DOG ─── */
.scene-dog {
	position: absolute;
	width: 90%;
	height: 90%;
	object-fit: contain;
	object-position: top right;
	z-index: 0;
}

/* ─── CLOUD ─── */
.scene-cloud {
	position: absolute;
	width: 150%;
	height: 120%;
	object-fit: contain;
	bottom: 1%;
	left: -19%;
	z-index: 1;

	opacity: 0;
	pointer-events: none;
	transition: opacity 0.6s ease;
}

.scene-cloud.visible {
	opacity: 0.5;
}

/* ─── STORY BOX ── */
/*
  Sits on top of the cloud. The box covers the cloud's main
  bubble area.
*/
.scene-story-box {
	position: absolute;
	top: 21%;
	left: 22%;
	width: 43%;
	z-index: 2;

	padding: 3%;

	opacity: 1;
	pointer-events: none;
	transition: opacity 0.6s ease;
}

.scene-story-box.visible {
	opacity: 1;
	pointer-events: all;
	transition: opacity 0.6s ease;
}

.scene-story {
	color: #eddcc6;
	font-family: "Mynerve", cursive;
	font-size: clamp(8px, 1.8vw, 23px);
	line-height: 1.7;
	text-align: center;
}

.generating {
	opacity: 1;
	pointer-events: all;
	animation: generating-pulse 1s ease-in-out infinite;
}

@keyframes generating-pulse {
	0%,
	100% {
		opacity: 0.1;
	}
	50% {
		opacity: 1;
	}
}

/* ─── FORM ─────────────────────────────────────────────────── */
.form-container {
	position: absolute;
	top: 16%;
	left: 10%;
	z-index: 10;
	transition:
		opacity 0.4s ease,
		transform 0.4s ease;
}

.form-container.hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px);
}

form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.search-input {
	font-family: "Mynerve", cursive;
	background-color: #fafaf8;
	color: #595959;
	border: none;
	border-radius: 6px;
	font-size: clamp(8px, 2vw, 18px);
	padding: 5px 20px;
	box-shadow: 5px 8px 18px 0 rgba(0, 0, 0, 0.1);
}

.search-input:focus {
	outline: none;
}

.search-input::placeholder {
	color: #59595985;
}

.search-button {
	font-family: "Mynerve", cursive;
	background-color: #7eacb5;
	border: none;
	border-radius: 6px;
	font-size: clamp(8px, 2vw, 18px);
	padding: 5px 20px;
	cursor: pointer;
	color: white;
	box-shadow: 5px 8px 18px 0 rgba(0, 0, 0, 0.1);
}

/* ─── BALL BUTTON ──────────────────────────────────────────── */
.scene-ball-btn {
	position: absolute;
	bottom: 17%;
	left: 20%;
	width: 5%;
	aspect-ratio: 1;

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0px;

	background: transparent;
	border: none;
	padding: 0;
	cursor: default;
	z-index: 10;

	opacity: 1;
	pointer-events: none;
	transition:
		opacity 0.4s ease,
		transform 0.3s ease;
}

.scene-ball-btn img {
	width: 60%;
	object-fit: contain;
	display: block;
}

.ball-label {
	font-family: "Mynerve", cursive;
	font-size: clamp(9px, 1.2vw, 16px);
	color: #eddcc6;
	white-space: nowrap;

	opacity: 0;
	transition: opacity 0.4s ease;
}

/* .active = after submit: ball is clickable and label appears */
.scene-ball-btn.active {
	pointer-events: all;
	cursor: pointer;
	animation: ball-pulse 2s ease-in-out infinite;
}

.scene-ball-btn.active .ball-label {
	opacity: 0.7;
}

.scene-ball-btn.active:hover {
	animation: none;
	transform: scale(1.2);
}

.scene-ball-btn.active:active {
	transform: scale(0.9);
}

@keyframes ball-pulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 0.6;
	}
	50% {
		transform: scale(1.1);
		opacity: 1;
	}
}

/* ─── FOOTER ─── */
footer {
	position: absolute;
	bottom: 1%;
	width: 100%;
	text-align: center;
	color: #eddcc6;
	font-size: xx-small;
	opacity: 0.5;
	font-family: "Montserrat", sans-serif;
	z-index: 5;
	pointer-events: none;
}

footer a {
	pointer-events: all;
	text-decoration: none;
	color: #7eacb5;
}

a:hover {
	color: #fa897a;
	transform: scale(1.5);
}
