html, body { margin: 0; height: 100%; background: #000; overflow: hidden; overscroll-behavior: none; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; position: fixed; inset: 0; }
#screen { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: -moz-crisp-edges; background: #000; display: block; }
#safe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#boot { position: fixed; inset: 0; display: grid; place-items: center; color: #fcfcfc; font: 14px monospace; background: #000; }
#dpad { --sz: 140px; position: fixed; width: var(--sz); height: var(--sz); display: none; z-index: 5; opacity: 0.55; }
#dpad.on { display: block; }
#dpad button { position: absolute; width: 36%; height: 36%; border: 3px solid #fcfcfc; background: rgba(40, 40, 60, 0.7); border-radius: 8px; padding: 0; touch-action: none; }
#dpad button.down { background: rgba(248, 216, 120, 0.9); }
#dpad .u { left: 32%; top: 0; } #dpad .d { left: 32%; bottom: 0; }
#dpad .l { left: 0; top: 32%; } #dpad .r { right: 0; top: 32%; }
#dpad button::after { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%); border: 9px solid transparent; }
#dpad .u::after { border-bottom: 14px solid #fcfcfc; border-top: 0; }
#dpad .d::after { border-top: 14px solid #fcfcfc; border-bottom: 0; }
#dpad .l::after { border-right: 14px solid #fcfcfc; border-left: 0; }
#dpad .r::after { border-left: 14px solid #fcfcfc; border-right: 0; }
