/* Spillsidene.no color scheme */
:root {
  --bg1: #07122a;
  --bg2: #0c1d3f;
  --panel: #171a2b;
  --panel-2: #1e2338;
  --card: #0f1a33;
  --text: #eaf1ff;
  --muted: #a7b2c9;
  --accent: #5ba8ff;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

::-webkit-scrollbar { 
	width: 16px;
}
::-webkit-scrollbar-track { 
	background-color: var(--bg2);
} 
::-webkit-scrollbar-thumb { 
	background-color: var(--muted);
}
::-webkit-scrollbar-thumb:hover { 
	background-color: var(--accent);
}

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

* { 
	font-family: Quadrit, sans-serif;
	font-size: 20px;
	color: var(--text);
}

html, body { 
	margin: 0px 0px 0px 0px;
	padding: 0px 0px 0px 0px;
	width: 100%;
	height: 100%;
	background: radial-gradient(1200px 800px at 20% 0%, #1b2040 0%, #0d1122 60%, #070a16 100%);
}
html  { 
	background-color: var(--bg1);
}
body { 
	position: relative;
	min-height: 100vh;
	overflow-x: hidden;
}

/* Game section styling to match 2048/Astroidejeger */
.game-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20px;
	min-height: calc(100vh - 56px);
	box-sizing: border-box;
}

/* Logo header override - ensure centering */
.logo-header {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 1001 !important;
	background: rgba(15, 23, 42, 0.95) !important;
	backdrop-filter: blur(10px) !important;
	padding: 8px 0 !important;
	text-align: center !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}

.logo-header a {
	font-family: Arial, sans-serif !important;
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 800 !important;
	font-size: 1.2rem !important;
	user-select: none !important;
	opacity: 0.9 !important;
	transition: opacity 0.2s ease !important;
	text-align: center !important;
}

.logo-header a:hover {
	opacity: 1 !important;
}

@media (max-width: 480px) {
	.logo-header {
		padding: 6px 0 !important;
	}
	.logo-header a {
		font-size: 1rem !important;
	}
}

/* Game title styling - matches 2048 */
.game-title {
	margin: 0 0 20px 0;
	font-weight: 800;
	letter-spacing: 0.3px;
	text-align: center;
	font-size: clamp(20px, 4vw, 32px);
	background: linear-gradient(90deg, #c7d6ff, #fff, #c7d6ff);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	flex-shrink: 0;
}


#score, #highscore  { 
	position: absolute;
	display: inline;
	top: 70px;
	margin: 0px;
	padding: 0px;
	width: 160px;
}
#highscore { 
	left: 180px;
}
#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: right;
	padding-right: 15px;
}
#score span, #highscore span { 
	padding-right: 0px;
}
#highscore span { 
	padding-right: 40px;
}
#message { 
	position: absolute;
	display: inline;
	top: 413px;
	left: 180px;
	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;
}
#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: 550px;
	height: 690px;
	margin: 20px auto;
	left: 0px;
	right: 0px;
	position: relative;
	padding: 5px 10px 10px 10px;
	background-color: #000;
}			
#board, #canvas-board, #canvas-paths, #canvas-fruits, #canvas-pacman, #canvas-bubbles, #canvas-ghost-blinky, #canvas-ghost-pinky, #canvas-ghost-inky, #canvas-ghost-clyde { 
	width: 550px;
	height: 550px;
	position: absolute;
}
#canvas-paths { 
	display: none;
}
#board {  
	position: relative;
}

#canvas-lifes, #canvas-level-fruits { 
	height: 30px;
	top: 670px;
	position: absolute;
	z-index: 111111;
}
#canvas-lifes { 
	width: 120px;
	left: 50px;
}
#canvas-level-fruits { 
	width: 265px;
	right: 50px;
}

#control { 
	position: absolute;
	margin: auto;
	left: 0px;
	right: 0px;
	bottom: -145px;
	width: 550px;
	height: 140px;
	background-color: #666;
	opacity: 0.7;
	display: none;
}
#control-up, #control-down, #control-up-second, #control-down-second, #control-left, #control-right, #control-up-big, #control-down-big, #control-left-big, #control-right-big { 
	position: absolute;
	margin: auto;
	background-repeat: no-repeat;
	background-position: 50% 50%;
	background-size: 64px;
	cursor: pointer;
	width: 64px;
	height: 64px;
	padding: 5px;
}
#control-up { 
	top: 0px;
	left: 70px;
	background-image: url('../img/move-up.png');
}
#control-down { 
	bottom: 0px;
	right: 70px;
	background-image: url('../img/move-down.png');
}
#control-up-second { 
	top: 0px;
	right: 70px;
	background-image: url('../img/move-up.png');
}
#control-down-second{ 
	bottom: 0px;
	left: 70px;
	background-image: url('../img/move-down.png');
}
#control-left { 
	bottom: 0px;
	top: 0px;
	left: 0px;
	background-image: url('../img/move-left.png');
}
#control-right { 
	bottom: 0px;
	top: 0px;
	right: 0px;
	background-image: url('../img/move-right.png');
}

#control-up-big, #control-down-big, #control-left-big, #control-right-big { 
	position: absolute;
	opacity: 0.2;
	margin: auto;
	padding: 0px;
	display: none;
	background-size: 98px;
	z-index: 999999;
}
#control-up-big { 
	bottom: 10px;
	left: 0px;
	right: 0px;
	width: 125px;
	height: 125px;
	background-image: url('../img/move-up-big.png');
}
#control-down-big { 
	bottom: -120px;
	left: 0px;
	right: 0px;
	width: 125px;
	height: 125px;
	background-image: url('../img/move-down-big.png');
}
#control-left-big { 
	left: 80px;
	bottom: -90px;
	width: 125px;
	height: 175px;
	background-image: url('../img/move-left-big.png');
}
#control-right-big { 
	right: 80px;
	bottom: -90px;
	width: 125px;
	height: 175px;
	background-image: url('../img/move-right-big.png');
}



h1 { 
	margin: 0px 0px 74px 0px;
	padding: 0px;
	font-size: 24px;
	letter-spacing: 3px;
	color: #fff;
	text-transform: uppercase;
	font-style: normal;
}
h3 { 
	margin: 0px;
	padding: 0px;
	font-size: 20px;
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
	font-style: normal;
}

.sound { 
	position: absolute;
}
.sound img { 
	height: 28px;
}
#home .sound { 
	bottom: 0px;
	right: 5px;
}
#panel .sound { 
	top: 77px;
	right: 5px;
}

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

.help-button { 
	position: absolute;
	text-align: center;
	bottom: 8px;
	right: 55px;
	margin: auto;
	font-size: 14px;
	font-weight: bold;
	text-transform: lowercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	color: #78abf7;
	transition: color 1.5s;
}
.help-button.yo { 
	color: #333;
}
#panel .help-button { 
	top: -510px;
	height: 25px;
}

#help h2 { 
	margin: 0px 0px 10px 0px;
	color: #d43b3b;
	text-transform: uppercase;
	font-weight: bold;
	font-size: 26px;
}
#help { 
	position: absolute;
	width: 420px;
	height: 265px;
	top: 290px;
	left: 0px;
	right: 0px;
	margin: auto;
	padding-top: 15px;
	text-align: center;
	z-index: 999999;
	background-color: #222;
	border: solid 1px #193fff;
	text-transform: uppercase;
	opacity: 0.9;
	display: none;
	cursor: pointer;
}
#help  table  tr  td { 
	font-size: 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);
}



@media screen and (min-height:1200px), screen and (min-device-height : 1200px) { 
	#panel, #home { 
		zoom: 135%;
	}
}

/* Game controls - matches Astroidejeger */
.game-controls {
	display: flex;
	gap: 20px;
	margin: 20px 0;
	justify-content: center;
}

.control-button {
	background: var(--bg2);
	color: var(--text);
	border: 1px solid var(--border);
	padding: 12px 24px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1rem;
	font-family: inherit;
	transition: all 0.3s ease;
}

.control-button:hover {
	background: var(--accent);
	color: var(--bg1);
	border-color: var(--accent);
}

.control-button:active {
	transform: translateY(1px);
}

/* Leaderboard - matches Astroidejeger */
.leaderboard {
	background: var(--bg2);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	min-width: 300px;
	max-width: 400px;
}

.leaderboard h3 {
	margin: 0 0 15px 0;
	color: var(--accent);
	text-align: center;
	font-size: 1.5rem;
}

.top-scores {
	list-style: none;
	padding: 0;
	margin: 0;
}

.top-scores li {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
	color: var(--text);
}

.top-scores li:last-child {
	border-bottom: none;
}

.top-scores li:nth-child(1) { color: #FFD700; } /* Gull */
.top-scores li:nth-child(2) { color: #C0C0C0; } /* Sølv */
.top-scores li:nth-child(3) { color: #CD7F32; } /* Bronse */

/* Info text - matches Astroidejeger */
.info-text {
	background: var(--bg2);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	max-width: 600px;
	text-align: center;
}

.info-text p {
	margin: 0;
	color: var(--text);
	line-height: 1.6;
}

@media (max-width: 480px) {
	.game-section {
		padding: 10px;
		min-height: calc(100vh - 44px);
	}
	
	.game-controls {
		gap: 10px;
	}
	
	.control-button {
		padding: 8px 16px;
		font-size: 0.9rem;
	}
	
	.leaderboard, .info-text {
		margin: 15px 0;
		padding: 15px;
		min-width: auto;
		max-width: 95vw;
	}
}

@media screen and (max-width:1024px), screen and (min-device-width : 768px) and (max-device-width : 1024px) { 
	#home .help-button, #panel .help-button, #home .github, #sound, .sound { 
		display: none;
	}
	#panel, #home { 
		zoom: 105%;
	}
	#control-up-big, #control-down-big, #control-left-big, #control-right-big { 
		display: inline; 
	} 

}
@media screen and (max-height:640px), screen and (min-device-height : 480px) and (max-device-height : 640px) and (-webkit-device-pixel-ratio: 3) { 
	#panel, #home { 
		zoom: 60%;
	}
	#control-up-big, #control-down-big, #control-left-big, #control-right-big { 
		display: inline; 
	} 
	#home .help-button, #panel .help-button, #home .github, #sound, .sound { 
		display: none;
	}
	h1, #canvas-panel-title-pacman { 
		visibility: hidden;
	}
}
@media screen and (max-height:480px), screen and (min-device-height : 320px) and (max-device-height : 480px) { 
	#panel, #home { 
		zoom: 55%;
	}
	#control-up-big, #control-down-big, #control-left-big, #control-right-big { 
		display: inline; 
	} 
	h1, #canvas-panel-title-pacman, #control-up-second, #control-down-second, #home .help-button, #panel .help-button, #home .github, #sound, .sound { 
		display: none;
	}
	#score, #highscore { 
		top: 0px;
	}
	#panel { 
		padding-top: 50px;
	}
	#canvas-lifes, #canvas-level-fruits { 
		top: 607px;
	}
	#control { 
		bottom: 50px;
		width: 550px;
		height: 55px;
	}
	#control-up, #control-down, #control-left, #control-right { 
		top: 0px;
		bottom: 0px;
		background-size: 48px;
		width: 48px;
		height: 48px;
		padding: 5px;
	}
	#message { 
		top: 347px;
	}
}
