/* The page around a demo (web/<demo>/index.html) */

:root {
	color-scheme: dark;
	--text: #aaa;
	--dim: #555;
	--link: #5ff;
}

html, body {
	margin: 0;
	height: 100%;
	background: #000;
	color: var(--text);
	font: 14px/1.4 system-ui, sans-serif;
}

body {
	display: flex;
	flex-direction: column;
}

a {
	color: var(--link);
}

/* The screen: 320x200 with square pixels, as large as fits */
#stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #000;
	cursor: pointer;
}

#stage.running {
	cursor: none;
}

#screen {
	width: 100%;
	height: 100%;
	object-fit: contain;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

/* The text screen the demo ends with */
#text {
	margin: 0;
	width: 80ch;
	font-family: "DejaVu Sans Mono", Consolas, "Courier New", monospace;
	line-height: 1;
	color: #aaa;
	cursor: default;
}

#text .cursor {
	animation: blink 1s steps(1) infinite;
}

@keyframes blink {
	50% { visibility: hidden; }
}

/* Before it runs: the demo's FILE_ID.DIZ and what is going on */
#intro {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5em;
	background: #000;
	font-family: "DejaVu Sans Mono", Consolas, "Courier New", monospace;
	pointer-events: none;
}

#diz {
	margin: 0;
	color: #aaa;
	font: inherit;
	font-size: clamp(9px, 2.6vh, 18px);
	line-height: 1.15;
}

#message {
	color: #fff;
	font-size: clamp(12px, 2.4vh, 18px);
	white-space: nowrap;
}

#bar {
	flex: none;
	padding: 6px 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	justify-content: space-between;
	color: var(--dim);
	font-size: 13px;
}

#bar .keys kbd {
	color: var(--text);
	font: inherit;
}

#after a {
	margin-left: 1em;
}

[hidden] {
	display: none !important;
}
