*{
	margin:0;
	padding:0;
	box-sizing: border-box;
}

main{
    width: 100%;
    min-height: 100dvh;
    padding-bottom: 40px;
}
.board{
    width: 100%;
    height: 70vh;
}
:root{
	/*background color*/
	--bg-primary-color: #0c0c0c;
	--bg-fill-color: #fdfdfc;
	--bg-food-color:red;


	/*text color*/
	--text-primary-color: #f0f0f0;

	/*spacing*/
	--space-xs:4px;
	--space-sm:8px;
	--space-md:16px;
	--space-lg:24px;
	--space-xl:32px;
	--space-xxl:40px;
	--space-xxxl:48px;

	/*border colors*/
	--border-primary-color:#333333;
	/*border radius*/
	--border-radius-xs:4px;
	--border-radius-sm:8px;
	--border-radius-md:16px;
	--border-radius-lg:24px;
	--border-radius-xl:32px;
	--border-radius-xxl:40px;

	/*font sizes*/
	--font-size-xs:12px;
	--font-size-sm:14px;
	--font-size-md:16px;
	--font-size-lg:18px;
	--font-size-xl:20px;
	--font-size-xxl:24px;

}
html,body{
	width: 100%;
	height:100%;
	background-color: var(--bg-primary-color);
	color: var(--text-primary-color);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
	overflow: hidden;
}

.btn{
	padding:var(--space-sm) var(--space-md);
	border:none;
	border-radius:var(--border-radius-sm);
	cursor: pointer;
	transition: all 0.3s ease;
	touch-action: manipulation;
}
.btn:hover{
	transform:scale(1.1) ;
}

.head{
	display: flex;
	justify-content: center;
	align-items: center;   /* keeps same line + perfect vertical alignment */
	gap: 10px;
}

.head img{
	width: 45px;
	height: 45px;
	object-fit: contain;
	display: block;
}

.head h1{
	margin: 0;
	font-size: 40px;
	line-height: 1;
	display: flex;
	align-items: center;
}
main{
	width: 100%;
	height: 100vh;
}

section{
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: var(--space-xxl);
	gap: var(--space-lg);
}
section .infos{
	width:100%;
	display: flex;
	justify-content: space-between;
}
.info{
	padding: var(--space-sm);
	border: 1px solid var(--border-primary-color);
	border-radius: var(--border-radius-md);
}
.board{
	margin-bottom: 20px;
	border: 1px solid var(--border-primary-color);
	flex-grow: 1;
	display: grid;
	grid-template-columns: repeat(auto-fill,minmax(30px,1fr));
	grid-template-rows: repeat(auto-fill,minmax(30px,1fr));
	position: relative;
	overflow: hidden;
}

.board::before{
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: url("icon.png") center/contain no-repeat;
	opacity: 0.15;   /* change this value */
	z-index: 0;
}

.block{
	border: 1px solid var(--border-primary-color);
	position: relative;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.fill{
	background-color: var(--bg-fill-color);
	transform: scale(0.92);
	border-radius: 4px;
}
.food{
	background-position: center;
	background-size: contain;
	background-repeat: no-repeat;
	animation: foodBlink 0.8s ease-in-out infinite;
}

@keyframes foodBlink{
	0%{
		transform: scale(1);
		opacity: 1;
	}
	50%{
		transform: scale(1.2);
		opacity: 0.7;
	}
	100%{
		transform: scale(1);
		opacity: 1;
	}
}
.modal{
	height: 100vh;
	width:100vw;
	position:fixed;
	top:0;
	background-color:#35353587 ;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter:blur(4px);
	display: flex;
	justify-content: center;
	align-items: center;
}
.modal .start-game,
.modal .game-over{
	display:flex;
	flex-direction:column;
	align-items:center;
	gap: var(--space-lg);
}
.modal .game-over{
	display: none;
}
.modal{
    z-index: 9999;
    pointer-events: auto;
}
.start-game,
.game-over{
    position: relative;
    z-index: 10000;
}

.btn{
    touch-action: manipulation;
    pointer-events: auto;
} 
