html, body.trion-body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: #000;
	overflow: hidden;
	color: #ffd6d6;
	font-family: "Courier New", ui-monospace, monospace;
	-webkit-tap-highlight-color: transparent;
	touch-action: none;
}
.trion-console {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(ellipse at center, #1a0306 0%, #000 70%);
}
#trion-canvas {
	display: block;
	max-width: 100vw;
	max-height: 100vh;
	aspect-ratio: 992 / 640;
	width: min(100vw, calc(100vh * 992 / 640));
	height: auto;
	image-rendering: auto;
	box-shadow: 0 0 40px rgba(255, 40, 60, .25);
	outline: none;
}
.trion-corner {
	position: fixed;
	bottom: 8px;
	right: 10px;
	opacity: .55;
	display: flex;
	gap: 6px;
	z-index: 5;
}
.trion-corner button, .trion-corner a {
	background: rgba(0,0,0,.6);
	color: #ff4a5a;
	border: 1px solid #ff2a40;
	border-radius: 6px;
	width: 32px;
	height: 32px;
	font-size: 16px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
	text-decoration: none;
	padding: 0;
}

.trion-corner:hover { opacity: 1; }
.trion-corner button[aria-pressed="true"] { opacity: .45; }

.trion-name {
	position: absolute;
	left: 50%;
	top: 58%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	z-index: 6;
}
.trion-name[hidden] { display: none; }
.trion-name label { color: #ff8090; letter-spacing: 4px; font-size: 14px; }
.trion-name input {
	background: #0a0002;
	color: #fff;
	border: 2px solid #ff2a40;
	box-shadow: 0 0 16px rgba(255, 42, 64, .6);
	font: bold 24px "Courier New", monospace;
	letter-spacing: 4px;
	text-transform: uppercase;
	text-align: center;
	width: 300px;
	padding: 8px;
	outline: none;
}
.trion-name button {
	background: #ff2a40;
	color: #000;
	border: 0;
	font: bold 16px "Courier New", monospace;
	letter-spacing: 3px;
	padding: 8px 22px;
	cursor: pointer;
}

/* Touch controls: only on coarse pointers. */
.trion-touch { display: none; }
@media (pointer: coarse) {
	.trion-corner { top: 8px; bottom: auto; }
	.trion-touch {
		display: flex;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		justify-content: space-between;
		align-items: flex-end;
		padding: 0 18px calc(18px + env(safe-area-inset-bottom));
		pointer-events: none;
		z-index: 4;
	}
	.trion-dpad {
		position: relative;
		width: 150px; height: 150px;
		pointer-events: auto;
	}
	.tb {
		position: absolute;
		width: 52px; height: 52px;
		border-radius: 12px;
		background: rgba(255, 42, 64, .14);
		border: 1px solid rgba(255, 70, 90, .7);
		color: #ff6070;
		font: bold 18px "Courier New", monospace;
		touch-action: none;
		user-select: none;
	}
	.tb.active { background: rgba(255, 42, 64, .5); color: #fff; }
	.tb.up { left: 49px; top: 0; }
	.tb.down { left: 49px; bottom: 0; }
	.tb.left { left: 0; top: 49px; }
	.tb.right { right: 0; top: 49px; }
	.trion-actions { display: flex; gap: 12px; pointer-events: auto; }
	.tb.act { position: static; width: 74px; height: 74px; border-radius: 50%; font-size: 13px; }
}
