:root {
	--bg: 						#f5f5f5;
	--surface: 				#ffffff;
	--text: 					#222222;
	--muted: 					#666666;
	--border: 				#d8d8d8;
	--input-bg: 			#ffffff;
	--input-border: 	#cccccc;
	--result-border: 	#eeeeee;
	--result-hover: 	#f2f2f2;
	--accent: 				#4f46e5;
}


body {
	background: var(--bg);
	color: #1e1e1e;

	overflow-y: scroll;
  scrollbar-gutter: stable both-edges;

	font-family: "Open Sans", Arial, sans-serif;
}


h1, h2, h3, h4, h5, h6 {
	text-transform: uppercase;
}


a {
	text-decoration: none;
}


audio {
	display: none !important;
}


#audio {
	display: block;
	width: calc(100% - 1.5em);
	margin: 0.5em .75em;
}


#header,
#submit-form {
	max-width: 640px;
	margin: auto;
}


#header {
	color: var(--text);
}


#submit-form {
	position: relative;
	background: #eee;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1em 2em 4em 2em;
	margin-bottom: 20px;
}


#game-container {
	position: relative;
	margin-bottom: 0em;
	max-width: 100%;
	min-height: 6em;
}


#game {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 0px;
	background: transparent;
	color: #1e1e1e;
	border: 0px solid var(--input-border);
	border-bottom: 1px solid var(--input-border);
	/*border-radius: .5em;*/

	font-weight: bold;
	font-size: 1.3em;
}


#game:focus {
	outline: none;
}


#igdb-results {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--surface);
	color: var(--text);

	border-top: none;
	z-index: 10;
}


.igdb-result {
	padding: 10px;
	cursor: pointer;
	border-top: 1px solid var(--result-border);
}


.igdb-result:hover {
	background: var(--result-hover);
}


.igdb-result-name {
	font-weight: bold;
}


.igdb-result-info {
	font-size: 0.9em;
	color: var(--muted);
	margin-top: 3px;
}


#igdb-status {
	min-height: 2em;
	margin-top: 5px;
	font-size: 0.9em;
	color: var(--muted);
}


.igdb-info {
	display: flex;
	flex-direction: row-reverse;
	height: 10em;
}


.igdb-info > * {
  border-radius: 5px;
}


.cover-art-image {
	display: inline-block;

	height: 16em;
	aspect-ratio: 3 / 4;
	object-fit: contain;
	margin: 0;
	margin-top: -0.5em;
	background-color: black;
	z-index: 1;

	box-shadow: 0px 3px 20px rgba(0, 0, 0, .5);
}

.cover-art-image[hidden] {
  display: none;

}

.release-year {
	display: inline-block;
	width: 75%;
	margin-top: 0.4em;
	font-size: 0.9em;
	color: var(--muted);
}

.release-year[hidden] {
    display: none;
}


input[type="file"]::file-selector-button  {
	display:none;
}


.button {
	display: inline-block;
	margin-top: 10px;
	padding: .5em 1em;
	background: green;
	color: #ffffff;
	border: none;
	border-radius: .5em;
	font-size: 1em;
	font-weight: bold;
}


.button:hover {
	background: darkgreen;
}


.game-label {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.4rem;
}


.info-button {
	border: none;
	background: none;
	padding: 0;
	margin: 0;

	color: #888;
	font-size: 0.95rem;
	line-height: 1;

	cursor: pointer;
}


.info-button:hover,
.info-button:focus-visible {
	color: #fff;
}


.info-button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}


.info-popover {
	position: absolute;
	z-index: 100;
	top: calc(100% + 0.6rem);
	left: 0;
	width: min(420px, calc(100vw - 2rem));
	padding: 1rem;

	background: #222;
	color: #eee;

	border: 1px solid #444;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);

	font-size: 0.9rem;
	line-height: 1.5;
}


.info-popover::before {
	content: "";
	position: absolute;

	top: -8px;
	left: 5.75em;

	width: 0;
	height: 0;

	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 8px solid #222;
}


.info-popover p {
	margin: 0;
}


.info-popover p + p {
	margin-top: 0.8rem;
}



@media (prefers-color-scheme: dark) {
	:root {
		--bg: 						#121212;
		--surface: 				#1e1e1e;
		--text: 					#eeeeee;
		--muted: 					#aaaaaa;
		--border: 				#3a3a3a;
		--input-bg:	 			#1e1e1e;
		--input-border:	 	#555555;
		--result-border:	#333333;
		--result-hover: 	#2a2a2a;
		--accent: 				#818cf8;
	}
}
