::-webkit-scrollbar { 
	width: 16px;
}
::-webkit-scrollbar-track { 
	background-color: #333;
} 
::-webkit-scrollbar-thumb { 
	background-color: #424e69;
}
::-webkit-scrollbar-thumb:hover { 
	background-color: #8295d5;
}

@font-face { 
	font-family: 'Quadrit'; 
	src: url('../css/Quadrit.ttf'); 
}

* { 
	font-family: Quadrit, sans-serif;
	font-size: clamp(14px, 2.5vw, 20px);
	color: #fff;
}

html, body { 
	margin: 0px 0px 0px 0px;
	padding: 0px 0px 0px 0px;
	width: 100%;
	height: 100vh;
	overflow-x: hidden;
}
html  { 
	background-color: #000;
}
body { 
	position: relative;
}


#score, #highscore  { 
	position: absolute;
	display: inline-block;
	top: 45px;
	margin: 0px;
	padding: 0px;
	width: 160px;
	z-index: 100;
}
#score { 
	left: 20px;
}
#highscore { 
	left: 50%;
	transform: translateX(-50%);
}
#score h2, #score span, #highscore h2, #highscore span { 
	display: block;
	text-transform: uppercase;
	font-weight: normal;
	letter-spacing: 2px;
	font-size: 16px;
	height: 21px;
	margin: 0px;
	padding: 0px;
	text-align: center;
}
#score span, #highscore span { 
	padding-right: 0px;
	text-align: center;
}
#message { 
	position: absolute;
	display: inline;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	margin: 0px;
	padding: 0px;
	width: 210px;
	height: 30px;
	text-transform: uppercase;
	font-weight: normal;
	letter-spacing: 2px;
	font-size: 20px;
	color: #fff200;
	text-align: center;
	z-index: 200;
}
#message.red { 
	color: red;
}

span.combo, span.fruits { 
	position: absolute;
	letter-spacing: 1.5px;
	font-size: 14px;
	color: #89dfff;
	font-weight: normal;
}

#panel, #home { 
	width: 100%;
	max-width: 600px;
	height: 100vh;
	margin: 0 auto;
	position: relative;
	padding: 0;
	background-color: #000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	overflow: hidden;
}			
#board, #canvas-board, #canvas-paths, #canvas-fruits, #canvas-pacman, #canvas-bubbles, #canvas-ghost-blinky, #canvas-ghost-pinky, #canvas-ghost-inky, #canvas-ghost-clyde { 
	width: 100%;
	height: 100%;
	max-width: 550px;
	max-height: 550px;
	position: absolute;
	top: 0;
	left: 0;
}
#canvas-paths { 
	display: none;
}
#board {  
	position: relative;
	width: min(90vw, calc(100vh - 200px));
	height: min(90vw, calc(100vh - 200px));
	max-width: 550px;
	max-height: 550px;
	aspect-ratio: 1 / 1;
	margin: 110px auto 10px auto;
	flex-shrink: 0;
}

#canvas-lifes, #canvas-level-fruits { 
	height: 30px;
	position: absolute;
	bottom: 10px;
	z-index: 100;
}
#canvas-lifes { 
	width: 120px;
	left: 20px;
}
#canvas-level-fruits { 
	width: 265px;
	right: 20px;
}

#control { 
	position: fixed;
	bottom: 50px;
	left: 50%;
	transform: translateX(-50%);
	width: 200px;
	height: 200px;
	background-color: transparent;
	opacity: 1;
	display: none;
	z-index: 250;
	pointer-events: none;
}
#control-up, #control-down, #control-left, #control-right { 
	position: absolute;
	background-color: rgba(30, 30, 30, 0.85);
	border: 3px solid #4a90e2;
	border-radius: 12px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 60%;
	cursor: pointer;
	width: 60px;
	height: 60px;
	opacity: 0.9;
	z-index: 2001;
	pointer-events: auto;
	transition: all 0.15s ease;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}
#control-up:active, #control-down:active, #control-left:active, #control-right:active {
	background-color: rgba(74, 144, 226, 0.5);
	border-color: #fff200;
	box-shadow: 0 0 15px rgba(255, 242, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.2);
	transform: scale(0.95);
}
#control-up-second, #control-down-second { 
	display: none !important;
}
#control-up { 
	top: 0px;
	left: 50%;
	transform: translateX(-50%);
	background-image: url('../img/move-up.png');
}
#control-up::before {
	content: '▲';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 24px;
	color: #4a90e2;
	pointer-events: none;
}
#control-down { 
	bottom: 0px;
	left: 50%;
	transform: translateX(-50%);
	background-image: url('../img/move-down.png');
}
#control-down::before {
	content: '▼';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 24px;
	color: #4a90e2;
	pointer-events: none;
}
#control-left { 
	left: 0px;
	top: 50%;
	transform: translateY(-50%);
	background-image: url('../img/move-left.png');
}
#control-left::before {
	content: '◀';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 24px;
	color: #4a90e2;
	pointer-events: none;
}
#control-right { 
	right: 0px;
	top: 50%;
	transform: translateY(-50%);
	background-image: url('../img/move-right.png');
}
#control-right::before {
	content: '▶';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 24px;
	color: #4a90e2;
	pointer-events: none;
}

#control-up-big, #control-down-big, #control-left-big, #control-right-big { 
	display: none !important;
}



h1 { 
	margin: 0;
	padding: 10px 0 8px 0;
	font-size: 24px;
	letter-spacing: 3px;
	color: #fff;
	text-transform: uppercase;
	font-style: normal;
	text-align: center;
	width: 100%;
	position: relative;
	z-index: 100;
}
h3 { 
	margin: 0px;
	padding: 0px;
	font-size: clamp(16px, 3vw, 20px);
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
	font-style: normal;
}

.sound { 
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 200;
	cursor: pointer;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 70%, #0a0a0a 100%);
	border: 2px solid #333;
	border-radius: 50%;
	box-shadow: 
		0 3px 6px rgba(0, 0, 0, 0.5),
		inset 0 1px 2px rgba(255, 255, 255, 0.1),
		inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}
.sound:hover {
	transform: scale(1.05);
	box-shadow: 
		0 4px 8px rgba(0, 0, 0, 0.6),
		inset 0 1px 2px rgba(255, 255, 255, 0.15),
		inset 0 -1px 2px rgba(0, 0, 0, 0.4);
	border-color: #4a90e2;
}
.sound img { 
	height: 20px;
	width: 20px;
}
#home .sound { 
	top: 8px;
	right: 8px;
}
#panel .sound { 
	top: 8px;
	right: 8px;
}

.github { 
	position: absolute;
	bottom: 0px;
	left: 5px;
}

.help-button { 
	position: absolute;
	text-align: center;
	top: 75px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 11px;
	font-weight: bold;
	text-transform: lowercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	color: #78abf7;
	transition: all 0.3s ease;
	z-index: 200;
	height: 18px;
	line-height: 18px;
	padding: 0 8px;
	border-radius: 3px;
	white-space: nowrap;
}
.help-button:hover { 
	color: #fff200;
	background-color: rgba(120, 171, 247, 0.15);
}
.help-button.yo { 
	color: #333;
}
#panel .help-button { 
	top: 75px;
	left: 50%;
	transform: translateX(-50%);
}
#home .help-button { 
	top: 75px;
	left: 50%;
	transform: translateX(-50%);
}

.pause-button {
	position: absolute;
	top: 8px;
	right: 58px;
	z-index: 200;
	cursor: pointer;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: all 0.25s ease;
	background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 70%, #0a0a0a 100%);
	border: 2px solid #333;
	border-radius: 50%;
	box-shadow: 
		0 3px 6px rgba(0, 0, 0, 0.5),
		inset 0 1px 2px rgba(255, 255, 255, 0.1),
		inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}
.pause-button:hover {
	transform: scale(1.05);
	box-shadow: 
		0 4px 8px rgba(0, 0, 0, 0.6),
		inset 0 1px 2px rgba(255, 255, 255, 0.15),
		inset 0 -1px 2px rgba(0, 0, 0, 0.4);
	border-color: #4a90e2;
}
.pause-button:active {
	transform: scale(0.95);
	box-shadow: 
		0 2px 4px rgba(0, 0, 0, 0.7),
		inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
.pause-icon {
	font-size: 16px;
	font-weight: 900;
	color: #e0e0e0;
	font-family: Arial, sans-serif;
	line-height: 1;
	display: block;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
	letter-spacing: 2px;
}
/* When game is PLAYING, show PAUSE icon (||) */
.pause-button[data-state="play"] .pause-icon {
	font-size: 16px;
	letter-spacing: 2px;
}
/* When game is PAUSED, show PLAY icon (▶) */
.pause-button[data-state="pause"] .pause-icon {
	font-size: 14px;
	letter-spacing: 0;
	margin-left: 2px;
}

.help-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #d43b3b;
	text-decoration: none;
	cursor: pointer;
	z-index: 1000000;
	transition: all 0.2s ease;
	font-weight: bold;
}
.help-close:hover {
	color: #fff200;
	transform: scale(1.2);
}

#help h2 { 
	margin: 0px 0px clamp(8px, 2vh, 10px) 0px;
	color: #d43b3b;
	text-transform: uppercase;
	font-weight: bold;
	font-size: clamp(20px, 4vw, 26px);
}
#help { 
	position: absolute;
	width: min(85vw, 420px);
	height: clamp(220px, 35vh, 265px);
	top: clamp(200px, 35vh, 290px);
	left: 0px;
	right: 0px;
	margin: auto;
	padding-top: clamp(10px, 2vh, 15px);
	text-align: center;
	z-index: 999999;
	background-color: #222;
	border: solid 1px #193fff;
	text-transform: uppercase;
	opacity: 0.9;
	display: none;
	cursor: pointer;
	max-width: 420px;
}
#help  table  tr  td { 
	font-size: clamp(12px, 2.5vw, 16px);
	letter-spacing: 1px;
}
#help  table  tr  td:first-child { 
	color: #f4c030;
	font-weight: bold;
	text-align: right;
}
#help  table  tr  td:last-child { 
	text-align: left;
}

#sound { 
	position: absolute;
}

.ui-mobile {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}



/* Hide controls on laptops and desktops - keyboard only */
@media screen and (min-width: 1025px) {
	#control {
		display: none !important;
	}
}

/* Show controls on tablets and mobile (up to 1024px) */
@media screen and (max-width: 1024px) {
	#control {
		display: block !important;
	}
}

/* Large tablets - iPad Pro and similar */
@media screen and (max-width: 1024px) and (min-width: 769px) {
	#panel, #home {
		max-width: 100%;
	}
	
	h1 {
		font-size: 22px;
		padding: 10px 0 5px 0;
	}
	
	#board {
		width: min(70vw, calc(100vh - 320px));
		height: min(70vw, calc(100vh - 320px));
		margin: 100px auto 15px auto;
	}
	
	#score, #highscore {
		top: 42px;
		width: 150px;
	}
	
	#score {
		left: 15px;
	}
	
	#score h2, #score span, #highscore h2, #highscore span {
		font-size: 15px;
		height: 19px;
	}
	
	#canvas-lifes {
		width: 110px;
		left: 15px;
		bottom: 15px;
		height: 28px;
	}
	
	#canvas-level-fruits {
		width: 240px;
		right: 15px;
		bottom: 15px;
		height: 28px;
	}
	
	/* D-Pad for large tablets */
	#control {
		bottom: 60px;
		width: 220px;
		height: 220px;
	}
	
	#control-up, #control-down, #control-left, #control-right {
		width: 60px;
		height: 60px;
		border-radius: 12px;
	}
	
	#control-up::before, #control-down::before, #control-left::before, #control-right::before {
		font-size: 24px;
	}
	
	.help-button {
		font-size: 10px;
		top: 70px;
		height: 16px;
		line-height: 16px;
		padding: 0 7px;
	}
	
	.pause-button {
		width: 34px;
		height: 34px;
		right: 54px;
		top: 8px;
	}
	
	.pause-icon {
		font-size: 15px;
	}
	
	.pause-button[data-state="play"] .pause-icon {
		font-size: 15px;
	}
	
	.pause-button[data-state="pause"] .pause-icon {
		font-size: 13px;
	}
	
	.sound {
		width: 34px;
		height: 34px;
		right: 8px;
		top: 8px;
	}
	
	.sound img {
		height: 18px;
		width: 18px;
	}
	
	.github {
		display: none;
	}
}

/* Tablets - iPad and similar (portrait and landscape) */
@media screen and (max-width: 768px) {
	#panel, #home {
		max-width: 100%;
	}
	
	h1 {
		font-size: 20px;
		padding: 8px 0 4px 0;
	}
	
	#board {
		width: min(75vw, calc(100vh - 320px));
		height: min(75vw, calc(100vh - 320px));
		margin: 100px auto 15px auto;
	}
	
	#score, #highscore {
		top: 40px;
		width: 140px;
	}
	
	#score {
		left: 10px;
	}
	
	#score h2, #score span, #highscore h2, #highscore span {
		font-size: 14px;
		height: 18px;
	}
	
	#canvas-lifes {
		width: 100px;
		left: 10px;
		bottom: 10px;
		height: 25px;
	}
	
	#canvas-level-fruits {
		width: 220px;
		right: 10px;
		bottom: 10px;
		height: 25px;
	}
	
	/* D-Pad for tablets */
	#control {
		bottom: 50px;
		width: 190px;
		height: 190px;
	}
	
	#control-up, #control-down, #control-left, #control-right {
		width: 52px;
		height: 52px;
		border-radius: 10px;
	}
	
	#control-up::before, #control-down::before, #control-left::before, #control-right::before {
		font-size: 21px;
	}
	
	.help-button {
		font-size: 9px;
		top: 68px;
		height: 14px;
		line-height: 14px;
		padding: 0 6px;
	}
	
	.pause-button {
		width: 32px;
		height: 32px;
		right: 50px;
		top: 8px;
	}
	
	.pause-icon {
		font-size: 14px;
	}
	
	.pause-button[data-state="play"] .pause-icon {
		font-size: 14px;
	}
	
	.pause-button[data-state="pause"] .pause-icon {
		font-size: 12px;
	}
	
	.sound {
		width: 32px;
		height: 32px;
		right: 7px;
		top: 8px;
	}
	
	.sound img {
		height: 16px;
		width: 16px;
	}
	
	.github {
		display: none;
	}
}

/* Mobile phones */
@media screen and (max-width: 500px) {
	body {
		overflow-x: hidden;
	}
	
	#panel, #home {
		max-width: 100%;
		padding: 0;
	}
	
	h1 {
		font-size: 18px;
		padding: 6px 0 3px 0;
	}
	
	h3 {
		font-size: 14px;
	}
	
	#board {
		width: min(80vw, calc(100vh - 340px));
		height: min(80vw, calc(100vh - 340px));
		margin: 90px auto 15px auto;
	}
	
	#score, #highscore {
		top: 35px;
		width: 110px;
	}
	
	#score {
		left: 5px;
	}
	
	#highscore {
		left: 50%;
		transform: translateX(-50%);
	}
	
	#score h2, #score span, #highscore h2, #highscore span {
		font-size: 12px;
		height: 16px;
	}
	
	#message {
		font-size: 16px;
		width: 180px;
	}
	
	#canvas-lifes {
		width: 80px;
		left: 5px;
		bottom: 5px;
		height: 22px;
	}
	
	#canvas-level-fruits {
		width: 180px;
		right: 5px;
		bottom: 5px;
		height: 22px;
	}
	
	/* D-Pad for mobile phones */
	#control {
		bottom: 38px;
		width: 160px;
		height: 160px;
	}
	
	#control-up, #control-down, #control-left, #control-right {
		width: 45px;
		height: 45px;
		border-radius: 9px;
		border-width: 2px;
	}
	
	#control-up::before, #control-down::before, #control-left::before, #control-right::before {
		font-size: 19px;
	}
	
	#help {
		width: 90vw;
		max-width: 350px;
		height: auto;
		min-height: 200px;
		padding: 15px;
	}
	
	#help h2 {
		font-size: 18px;
		margin-bottom: 10px;
	}
	
	#help table tr td {
		font-size: 12px;
	}
	
	.help-button {
		font-size: 8px;
		top: 64px;
		height: 12px;
		line-height: 12px;
		padding: 0 5px;
	}
	
	.pause-button {
		width: 28px;
		height: 28px;
		right: 44px;
		top: 8px;
	}
	
	.pause-icon {
		font-size: 12px;
	}
	
	.pause-button[data-state="play"] .pause-icon {
		font-size: 12px;
		letter-spacing: 1px;
	}
	
	.pause-button[data-state="pause"] .pause-icon {
		font-size: 10px;
	}
	
	.sound {
		width: 28px;
		height: 28px;
		right: 6px;
		top: 8px;
	}
	
	.sound img {
		height: 14px;
		width: 14px;
	}
	
	.sound {
		top: 8px;
		right: 8px;
	}
	
	.sound img {
		height: 20px;
		width: 20px;
	}
	
	.github {
		display: none;
	}
}

/* Very small mobile phones */
@media screen and (max-width: 360px) {
	h1 {
		font-size: 16px;
		padding: 5px 0 2px 0;
	}
	
	#board {
		width: min(82vw, calc(100vh - 350px));
		height: min(82vw, calc(100vh - 350px));
		margin: 85px auto 12px auto;
	}
	
	#score, #highscore {
		top: 32px;
		width: 100px;
	}
	
	#score {
		left: 3px;
	}
	
	#highscore {
		left: 50%;
		transform: translateX(-50%);
	}
	
	#score h2, #score span, #highscore h2, #highscore span {
		font-size: 11px;
		height: 14px;
	}
	
	#message {
		font-size: 14px;
		width: 150px;
	}
	
	#canvas-lifes {
		width: 70px;
		left: 3px;
		bottom: 3px;
		height: 20px;
	}
	
	#canvas-level-fruits {
		width: 150px;
		right: 3px;
		bottom: 3px;
		height: 20px;
	}
	
	/* Compact D-Pad for small phones */
	#control {
		bottom: 30px;
		width: 140px;
		height: 140px;
	}
	
	#control-up, #control-down, #control-left, #control-right {
		width: 39px;
		height: 39px;
		border-radius: 8px;
		border-width: 2px;
	}
	
	#control-up::before, #control-down::before, #control-left::before, #control-right::before {
		font-size: 17px;
	}
	
	.help-button {
		font-size: 7px;
		top: 58px;
		height: 10px;
		line-height: 10px;
		padding: 0 4px;
	}
	
	.pause-button {
		width: 26px;
		height: 26px;
		right: 38px;
		top: 7px;
	}
	
	.pause-icon {
		font-size: 11px;
	}
	
	.pause-button[data-state="play"] .pause-icon {
		font-size: 11px;
		letter-spacing: 1px;
	}
	
	.pause-button[data-state="pause"] .pause-icon {
		font-size: 9px;
	}
	
	.sound {
		width: 26px;
		height: 26px;
		right: 5px;
		top: 7px;
	}
	
	.sound img {
		height: 12px;
		width: 12px;
	}
	
	.sound {
		top: 6px;
		right: 6px;
	}
	
	.sound img {
		height: 18px;
		width: 18px;
	}
}

/* Landscape orientation adjustments for mobile/tablet */
@media screen and (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
	#panel, #home {
		height: 100vh;
		padding: 0;
	}
	
	h1 {
		font-size: 14px;
		padding: 3px 0 2px 0;
	}
	
	#board {
		width: min(40vw, calc(100vh - 200px));
		height: min(40vw, calc(100vh - 200px));
		margin: 55px auto 8px auto;
	}
	
	#score, #highscore {
		top: 22px;
		width: 100px;
	}
	
	#score h2, #score span, #highscore h2, #highscore span {
		font-size: 11px;
		height: 14px;
	}
	
	#canvas-lifes, #canvas-level-fruits {
		bottom: 5px;
		height: 18px;
	}
	
	#canvas-lifes {
		width: 70px;
		left: 5px;
	}
	
	#canvas-level-fruits {
		width: 150px;
		right: 5px;
	}
	
	/* Compact D-Pad for landscape */
	#control {
		bottom: 28px;
		width: 120px;
		height: 120px;
	}
	
	#control-up, #control-down, #control-left, #control-right {
		width: 34px;
		height: 34px;
		border-radius: 7px;
		border-width: 2px;
	}
	
	#control-up::before, #control-down::before, #control-left::before, #control-right::before {
		font-size: 15px;
	}
	
	.help-button {
		font-size: 7px;
		top: 54px;
		height: 10px;
		line-height: 10px;
		padding: 0 4px;
	}
	
	.pause-button {
		width: 24px;
		height: 24px;
		right: 34px;
		top: 6px;
	}
	
	.pause-icon {
		font-size: 10px;
	}
	
	.pause-button[data-state="play"] .pause-icon {
		font-size: 10px;
		letter-spacing: 1px;
	}
	
	.pause-button[data-state="pause"] .pause-icon {
		font-size: 8px;
	}
	
	.sound {
		width: 24px;
		height: 24px;
		right: 4px;
		top: 6px;
	}
	
	.sound img {
		height: 11px;
		width: 11px;
	}
	
	.sound {
		top: 5px;
		right: 5px;
	}
	
	.sound img {
		height: 18px;
		width: 18px;
	}
}
