@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

* {
	box-sizing: border-box;
}

body#game {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
	background-attachment: fixed;
	margin: 0;
	padding: 0;
	font-family: 'Outfit', sans-serif;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	color: #f8fafc;
	overflow-x: hidden;
}

/* Glassmorphic 3D Container */
.glass-container {
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 24px;
	box-shadow: 
		0 25px 50px rgba(0, 0, 0, 0.5),
		0 10px 20px rgba(0, 0, 0, 0.3),
		inset 0 1px 1px rgba(255, 255, 255, 0.2);
	padding: 40px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 50px;
	perspective: 1000px;
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

@media (max-width: 900px) {
	.glass-container {
		flex-direction: column;
		padding: 20px;
		gap: 20px;
	}
}

/* Side Panels */
.side-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

/* Game Board */
#game_panel {
	margin: 0;
}

#div_main {
	width: 400px;
	height: 400px;
	box-sizing: content-box;
	border: 4px solid rgba(56, 189, 248, 0.3);
	border-radius: 12px;
	background: rgba(15, 23, 42, 0.8);
	box-shadow: 
		inset 0 0 30px rgba(0, 0, 0, 0.8),
		0 0 20px rgba(56, 189, 248, 0.2);
	position: relative;
	transform-style: preserve-3d;
}

/* Scale board for very small screens */
@media (max-width: 450px) {
	#div_main {
		transform: scale(0.8);
		transform-origin: top center;
		margin-bottom: -80px;
	}
}

/* Cells */
.curr_cell {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.04);
	width: 20px;
	height: 20px;
	float: left;
	box-sizing: border-box;
}

.cell_bg {
	background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
	border-radius: 4px;
	/* Create a 3D block effect for the snake */
	box-shadow: 
		1px 1px 0 #0284c7, 
		2px 2px 0 #0369a1, 
		3px 3px 0 #075985, 
		4px 4px 5px rgba(0,0,0,0.6) !important;
	border: none !important;
	transform: translate(-2px, -2px);
}

.cell {
	background-color: #f43f5e !important;
	background-image: url('bug.png');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
	border-radius: 50%;
	/* 3D sphere effect for the bug */
	box-shadow: 
		inset -3px -3px 6px rgba(0,0,0,0.3),
		inset 2px 2px 6px rgba(255,255,255,0.5),
		0 0 15px #f43f5e,
		3px 3px 5px rgba(0,0,0,0.5) !important;
	border: none !important;
	animation: pulseBug 1s ease-in-out infinite alternate;
	transform: translateZ(10px);
}

@keyframes pulseBug {
	0% { transform: scale(0.85); box-shadow: 0 0 8px #f43f5e; }
	100% { transform: scale(1.1); box-shadow: 0 0 20px #f43f5e; }
}

/* Button */
.myButton { 
	background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50px;
	display: inline-block;
	cursor: pointer;
	color: #ffffff;
	font-family: 'Outfit', sans-serif;
	font-size: 18px;
	font-weight: 700;
	padding: 12px 30px;
	text-decoration: none;	
	text-transform: uppercase;
	letter-spacing: 1.5px;
	box-shadow: 
		0 8px 20px rgba(56, 189, 248, 0.3),
		0 4px 0px #1e40af,
		inset 0 1px 1px rgba(255, 255, 255, 0.4);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.myButton:hover {	
	transform: translateY(-2px);
	box-shadow: 
		0 12px 25px rgba(56, 189, 248, 0.4),
		0 5px 0px #1e40af,
		inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.myButton:active {	
	transform: translateY(2px) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 0px #1e40af !important;
}

/* Modal Styles */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(5px);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.modal-content {
	flex-direction: column;
	padding: 40px 60px;
	text-align: center;
	gap: 20px;
}

.modal-content h2 {
	margin: 0;
	font-size: 2.5em;
	color: #f43f5e;
	text-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
}

.modal-content p {
	font-size: 1.2em;
	color: #e2e8f0;
	margin: 0 0 15px 0;
}

.modal-buttons {
	display: flex;
	gap: 20px;
	justify-content: center;
}

.modal-btn {
	padding: 10px 25px;
	font-size: 16px;
}

.cancel-btn {
	background: linear-gradient(135deg, #64748b 0%, #475569 100%);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 4px 0px #334155, inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
	box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4), 0 5px 0px #334155, inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.cancel-btn:active {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 0px #334155 !important;
}
