html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: #ffffff;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}

#frame {
	position: fixed;
	inset: 0;
	font-size: 12px;
	font-family: 'Lucida Console', Monaco, monospace;
}

#canvasm, #canvass {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#canvasm { z-index: 0; }
#canvass { z-index: 1; }

#controlsview {
	position: absolute;
	inset: 0;
	background-color: #ffffff;
	opacity: 0;
	z-index: -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	font-size: 14px;
	line-height: 1.7;
	text-align: center;
	pointer-events: none;
}

#controlsview.show {
	opacity: 0.92;
	z-index: 4;
}

#creditsimg {
	position: fixed;
	right: 1%;
	top: 1%;
	z-index: 2;
	opacity: 0;
}

#creditsimg.show { opacity: 1; }

#score {
	position: fixed;
	left: 1%;
	bottom: 1%;
	z-index: 3;
	font-size: 14px;
}

.menu {
	position: fixed;
	bottom: 1%;
	right: 1%;
	z-index: 3;
	display: flex;
	gap: 14px;
}

.menu a {
	color: #000;
	text-decoration: underline;
	cursor: pointer;
}

#brand {
	position: fixed;
	top: 8px;
	left: 10px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	color: #333;
	pointer-events: none;
}

#brand img { height: 18px; }

/* Controles táctiles: sólo en pantallas sin puntero fino */
#touch {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 34px;
	z-index: 5;
	justify-content: space-between;
	padding: 0 14px;
	pointer-events: none;
}

#touch .pad, #touch .act {
	display: flex;
	gap: 8px;
	pointer-events: auto;
}

#touch button {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 2px solid #444;
	background: rgba(255,255,255,0.85);
	font-size: 22px;
	font-family: inherit;
	color: #222;
	touch-action: manipulation;
}

#touch button.wide {
	width: auto;
	padding: 0 18px;
	border-radius: 29px;
	font-size: 14px;
}

#touch button:active { background: #ddd; }

@media (pointer: coarse) {
	#touch { display: flex; }
	.menu { bottom: auto; top: 32px; right: 10px; font-size: 11px; gap: 10px; }
	#score { bottom: 6px; left: 50%; transform: translateX(-50%); }
	#brand { font-size: 10px; gap: 6px; }
	#brand img { height: 13px; }
	#creditsimg { top: 54px; }
}
