/* style.css - Core Layout & Grid System */

body {
	margin: 0;
	overflow: hidden;
	background-color: #001f3f;
}

* {
	box-sizing: border-box;
}

@font-face {
	font-family: 'CustomFont';
	src: url('font.ttf') format('truetype');
}

@font-face {
	font-family: 'PixelFish';
	src: url('fonts/pixelFish.ttf') format('truetype');
}

@font-face {
	font-family: 'HackBold';
	src: url('fonts/Hack-Bold.ttf') format('truetype');
}

@font-face {
	font-family: 'HackRegular';
	src: url('fonts/Hack-Regular.ttf') format('truetype');
}

@font-face {
	font-family: 'GhostFont';
	src: url('fonts/ghost.otf') format('opentype');
}

@font-face {
	font-family: 'GlassFont';
	src: url('fonts/glass.ttf') format('truetype');
}

#aquarium {
	position: relative;
	width: 100vw;
	height: 100vh;
	z-index: 1;
}

/* --- UI Grid Positioning --- */

#ui-layer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 1000;
}

.pos-container {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 33vw;
	pointer-events: none;
}

/* Row 1: Top (1, 2, 3) */
#pos-1 {
	top: 40px;
	left: 40px;
	align-items: flex-start;
}

#pos-1 .donation-alert {
	transform-origin: top left;
}

#pos-2 {
	top: 40px;
	left: 50%;
	transform: translateX(-50%);
	align-items: center;
}

#pos-2 .donation-alert {
	transform-origin: top center;
}

#pos-3 {
	top: 40px;
	right: 40px;
	align-items: flex-end;
}

#pos-3 .donation-alert {
	transform-origin: top right;
}

/* Row 2: Middle (4, 5, 6) */
#pos-4 {
	top: 50%;
	left: 40px;
	transform: translateY(-50%);
	align-items: flex-start;
}

#pos-4 .donation-alert {
	transform-origin: center left;
}

#pos-5 {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	align-items: center;
}

#pos-5 .donation-alert {
	transform-origin: center center;
}

#pos-6 {
	top: 50%;
	right: 40px;
	transform: translateY(-50%);
	align-items: flex-end;
}

#pos-6 .donation-alert {
	transform-origin: center right;
}

/* Row 3: Bottom (7, 8, 9) */
#pos-7 {
	bottom: 40px;
	left: 40px;
	align-items: flex-start;
}

#pos-7 .donation-alert {
	transform-origin: bottom left;
}

#pos-8 {
	bottom: 40px;
	left: 50%;
	transform: translateX(-50%);
	align-items: center;
}

#pos-8 .donation-alert {
	transform-origin: bottom center;
}

#pos-9 {
	bottom: 40px;
	right: 40px;
	align-items: flex-end;
}

#pos-9 .donation-alert {
	transform-origin: bottom right;
}

/* --- Base Alert Styles --- */

.donation-alert {
	text-align: center;
	min-width: 320px;
	max-width: 100%;
	font-family: 'CustomFont', Arial, sans-serif;
	animation: alert-pop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
	will-change: transform, opacity;
}

.alert-user {
	font-size: 38px;
	font-weight: bold;
	margin-bottom: 8px;
}

.alert-message {
	font-size: 32px;
	word-wrap: break-word;
}

.donation-alert.fade-out {
	animation: alert-fade-out 0.8s ease-in forwards;
}

@keyframes alert-pop-in {
	0% {
		opacity: 0;
		transform: scale(0.5);
	}

	100% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes alert-fade-out {
	0% {
		opacity: 1;
		transform: scale(1);
	}

	100% {
		opacity: 0;
		transform: scale(0.8);
	}
}

/* --- Fish & Bubbles --- */

.fish {
	position: absolute;
	width: 160px;
}

.fish-spawn-animation {
	animation: spawn-in 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes spawn-in {
	0% {
		opacity: 0;
		transform: scale(0.3) translateY(-80px);
	}

	60% {
		opacity: 1;
		transform: scale(1.1) translateY(0);
	}

	100% {
		opacity: 1;
		transform: scale(1);
	}
}

.spawn-bubble {
	position: fixed;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.3);
	border: 2px solid rgba(255, 255, 255, 0.6);
	pointer-events: none;
	--random-x-end: 0px;
	--random-y-end: 0px;
	--random-scale-end: 0.2;
	animation: bubble-burst 1s ease-out forwards;
}

@keyframes bubble-burst {
	0% {
		opacity: 0.9;
		transform: translate(-50%, -50%) scale(0.1);
	}

	100% {
		opacity: 0;
		transform: translate(calc(-50% + var(--random-x-end)), calc(-50% + var(--random-y-end))) scale(var(--random-scale-end));
	}
}

.fish-sprite {
	width: 100%;
	height: auto;
	image-rendering: pixelated;
}

.fish-info {
	position: absolute;
	bottom: 85%;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	color: white;
	text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
	font-family: 'PixelFish', sans-serif;
}

/* --- Meme Alerts --- */
.meme-container {
	position: absolute;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	background: black;
	border: 5px solid white;
	border-radius: 15px;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);

	/* Strict maximums so container NEVER overflows screen */
	max-width: 50vw;
	max-height: 50vh;
	overflow: hidden;
}

.meme-visual {
	/* Push strict max constraints onto the video element itself so aspect-ratio conforms */
	max-width: 50vw;
	max-height: 50vh;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
}