:root {
	--q-red: rgb(237, 54, 36);
	--q-carbon-gray: rgb(61, 61, 61);
	--q-taylor: rgb(0, 191, 179);
	--q-yeezy: rgb(249, 212, 35);
	--q-katy: rgb(210, 110, 230);
	--q-gaga: rgb(151, 215, 0);
	--q-bruno: rgb(91, 194, 231);
	--q-letter-spacing: -0.03em;
}

@font-face {
	font-family: 'Cervo-Medium';
	src:	url('https://fonts.qmusic.be/cervo-medium-webfont.woff2') format("woff2"),
			url('https://fonts.qmusic.be/cervo-medium-webfont.ttf') format("truetype");
	font-style: normal;
	font-weight: 600;
	font-display: block;
}

@font-face {
	font-family: 'Qarla';
	src:	url('https://fonts.qmusic.be/qarla-bold-webfont.woff2') format("woff2"),
			url('https://fonts.qmusic.be/qarla-bold-webfont.ttf') format("truetype");
	font-weight: bold;
	font-style: normal;
	font-display: block;
}

* {
	-webkit-user-select: none;
	user-select: none;
}

body {
	margin: 0;
	padding: 0;
	letter-spacing: -0.03em;
	background-color: var(--q-red);
}
/*
body.normal-viewport {
	overflow: hidden;
}*/

p, table, .controller-table {
	font-family: "Qarla";
	color: #fff;
	font-size: 18pt;
}

/*
svg {
	pointer-events: none;
}
*/

.controller-table {
	font-size: 14pt;
}

h1 {
	font-family: 'Cervo-Medium';
	text-transform: uppercase;
	letter-spacing: var(--q-letter-spacing);
	color: #fff;
	font-size: 320%;
	margin: 0;
}

h2 {
	font-family: 'Cervo-Medium';
	text-transform: uppercase;
	letter-spacing: var(--q-letter-spacing);
	color: #fff;
	font-size: 200%;
	margin: 32px 0 0 0;
}

a {
	color: #fff;
}

#wrapper {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	min-height: 100vh;
	background-image: url('/assets/images/pixel-gradientje.png');
	background-repeat: repeat-x;
	background-position-y: bottom;
}

header {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-around;
}

#logo {
	margin: 48px;
	width: 40%;
	max-width: 600px;
}

#logo img {
	width: 100%;
	transform: rotate(-4deg);
}

#content {
	width: 100%;
	height: fit-content;
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-around;
}

button {
	background-color: white;
	color: var(--q-red);
	border: none;
	border-radius: 8px;
	margin: 40px 0 20px 0;
	font-family: "Cervo-Medium", "Cervo Medium";
	font-size: 32pt;
	text-transform: uppercase;
	padding: 4px 16px;
	cursor: pointer;
	transition: box-shadow 200ms, background 200ms;
}

button:hover {
	box-shadow: 0 0px 12px 2px rgb(255 255 255 / 60%);
}

button:active {
	background-color: #fbd3d0;
	box-shadow: none;
}

#qlogo {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-around;
}

#qlogo img {
	width: 64px;
	padding: 24px;
}

footer {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
}

footer img {
	width: 25%;
}

@media screen and (min-width: 600px) {
	
	#video-container {
		height: 40vh;
	}
	
}

@media screen and (min-width: 400px) and (max-width: 800px) {
	
	#logo {
		margin: 36px;
	}
	
	footer {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
	}
	
	footer img {
		width: 50%;
	}
}

@media screen and (max-width: 600px) {
	
	#qlogo img {
		width: 48px;
		padding: 20px;
	}
	
	#logo {
		display: none;
	}
	
}

@media screen and (max-width: 400px) {
	
	#logo {
		margin: 16px;
	}
	
	footer {
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
	}
	
	footer img {
		width: 100%;
	}
	
	#ab-buttons img {
		width: calc(50% - 4px);
	}
}

/* NES */

#canvas-container {
	width: 640px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	align-content: center;
}

.fullscreen-viewport #canvas-container {
	justify-content: flex-start;
	background: var(--q-taylor);
}

#nes-canvas {
	display: none;
}

#canvas-placeholder {
	display: block;
	background-image: url('/assets/images/placeholder-blurred.png');
	background-position: center;
	background-repeat: no-repeat;
	
	aspect-ratio: 16 / 15;
	display: flex;
	align-items: center;
	flex-flow: row nowrap;
	align-content: center;
}

.pixelated {
	transform-origin: center;
	image-rendering: pixelated;
	background: black;
	aspect-ratio: 16 / 15;
	height: auto;
}

/* Disable guesture (maybe for iphone, but disables also scrolling) */
#onscreen-controller {
	touch-action: pan-y;
}

@media screen and (min-width: 600px) {
	#onscreen-controller {
		display: none;
	}
	
	#nes-canvas,
	#canvas-placeholder {
		width: 640px;
	}
	
	#canvas-placeholder {
		height: 600px;
	}
}

@media screen and (max-width: 600px) {
	
	#nes-canvas,
	#canvas-placeholder {
		width: 100%;
	}

	#onscreen-controller {
		width: calc(100% - 16px);
		height: calc(100% - 16px);
		display: flex;
		flex-direction: column;
		padding: 8px;
		row-gap: 50px;
	}

	#controller-main-buttons {
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		gap: 8px;
	}

	#ab-buttons {
		display: flex;
		gap: 8px;
		flex-direction: row;
		justify-content: flex-end;
		align-self: center;
	}

	#controller-secondary-buttons {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: space-around;
	}

}

#controller-main-buttons div {
	flex-basis: 50%;
	overflow: hidden;
}

#d-pad {
	max-width: 100%;
}

#button-mapping-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(5, 1fr);
	grid-column-gap: 0px;
	grid-row-gap: 0px;
	justify-items: center;
	align-items: center;
}