/* The emulator overlay of the releases page (see emulator.js) */
.emu-play {
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}
.emu-play:hover img,
.emu-play:focus-visible img {
	transform: scale(1.2);
}
body.emu-open {
	overflow: hidden;
}
.emu-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 8, 24, 0.82);
	overflow-y: auto;
}
.emu-overlay[hidden] {
	display: none;
}
.emu-window {
	position: relative;
	margin: auto;
	/* the screen is 768x544; the title and the controls take about 120px */
	width: min(94vw, calc((100vh - 230px) * 768 / 544), 1100px);
	padding: 44px 14px 8px;
	border-radius: 14px;
	background: var(--surface, #201624);
	color: #fff;
	box-shadow: var(--shadow, 0 12px 30px rgba(10, 6, 12, 0.35));
}
.emu-title {
	position: absolute;
	top: 6px;
	left: 14px;
	right: 46px;
	font-size: 13px;
	line-height: 16px;
	color: var(--accent-yellow, #fff27a);
}
.emu-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: var(--accent, #ff3ea5);
	color: #fff;
	font-size: 18px;
	line-height: 22px;
	cursor: pointer;
}
.emu-close:hover,
.emu-close:focus-visible {
	background: #ff6fbd;
}
.emu-screen {
	width: 100%;
	aspect-ratio: 768 / 544;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}
.emu-screen canvas:focus {
	outline: 2px solid var(--accent-green-light, #5aee8f);
	outline-offset: -2px;
}
.emu-status {
	min-height: 20px;
	margin-top: 6px;
	font-size: 11px;
	color: var(--accent-cyan, #42f2f7);
}
.emu-crt-status:not(:empty), .emu-speed-warning:not(:empty), .emu-audio-status:not(:empty) {
	margin-top: 4px;
	font-size: 11px;
	color: var(--accent-yellow, #fff27a);
}
.emu-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	justify-content: center;
	margin-top: 4px;
}
.emu-controls button {
	padding: 2px 9px;
	border: 0;
	border-radius: 11px;
	font-size: 12px;
	background: var(--card, #c8a3d1);
	color: var(--ink, #1d151f);
	font-family: inherit;
	cursor: pointer;
}
.emu-controls button:hover,
.emu-controls button:focus-visible {
	background: var(--accent-yellow, #fff27a);
}
.emu-controls input[type="range"] {
	width: 90px;
	accent-color: var(--accent, #ff3ea5);
}

.emu-led-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 3px 2px 0; }
.emu-speed { font-size: 11px; font-variant-numeric: tabular-nums; }
.emu-led { width: 9px; height: 9px; background: #400; border: 1px solid #222; }
.emu-led.on { background: #a11; }
.emu-led.on.busy { background: #f44; box-shadow: 0 0 6px #f22; }
.emu-option { font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.emu-option[hidden] { display: none; }
.emu-option select { font: inherit; font-size: 12px; max-width: 160px; }
.emu-vkeyboard {
	position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 1001;
	display: flex; gap: 12px; align-items: flex-start; justify-content: center;
	width: min(98vw, 780px); padding: 8px; border-radius: 10px; box-sizing: border-box;
	background: var(--surface, #201624); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
	user-select: none; touch-action: none;
}
.emu-vkeyboard[hidden] { display: none; }
.emu-vkeyboard { position: fixed; }
.emu-vkeyboard .emu-vclose {
	position: absolute; top: -12px; right: -6px; width: 26px; height: 26px; border-radius: 50%;
	font-size: 18px; line-height: 1; background: var(--accent, #ff3ea5); color: #fff;
}
.emu-vmain, .emu-vpad { display: grid; grid-auto-rows: clamp(22px, 3.3vw, 31px); gap: 2px; }
.emu-vmain { flex: 15 1 0; }
.emu-vpad { flex: 3 1 0; }
.emu-vkeyboard button {
	min-width: 0; padding: 0; border: 0; border-bottom: 2px solid #8d8b86; border-radius: 3px;
	font-size: clamp(9px, 1.45vw, 13px); font-weight: 700; line-height: 1.1; white-space: pre;
	background: #cfcdc7; color: #262626; /* the light grey of the 6128's keys */
	font-family: inherit; cursor: pointer;
	transition: transform 60ms, box-shadow 60ms, filter 60ms;
}
/* the RETURN key is an L: wide at the top (it fills the corner right of the "{" key), narrower below */
.emu-vkeyboard button.vret {
	clip-path: polygon(0 0, 100% 0, 100% 100%, 16.67% 100%, 16.67% 50%, 0 50%);
	padding-left: 16.67%; border-bottom: 0; font-size: clamp(8px, 1.25vw, 11px);
}
.emu-vkeyboard button:hover { filter: brightness(1.06); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55); position: relative; z-index: 1; }
/* a pressed key sinks: it shrinks a little, its shadow and its lower edge go */
.emu-vkeyboard button:active, .emu-vkeyboard button.down, .emu-vkeyboard button.latched {
	transform: scale(0.93); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45); border-bottom-width: 0; filter: brightness(0.94);
}
/* the L of RETURN is cut out: a shadow would be clipped, so it darkens instead */
.emu-vkeyboard button.vret:hover { box-shadow: none; filter: brightness(1.1); }
.emu-vkeyboard button.vret:active, .emu-vkeyboard button.vret.down { box-shadow: none; transform: scale(0.95); }
.emu-vkeyboard button.down { background: var(--accent-yellow, #fff27a); }
.emu-vkeyboard button.latched { background: var(--accent, #ff3ea5); color: #fff; }
