* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background-color: #03040a;
  color: #fff;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  font-family: Arial, Helvetica, sans-serif;
  touch-action: none;
}

body {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(116, 170, 255, 0.65) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.5px);
  background-position: 12px 16px, 43px 37px, 68px 11px;
  background-size: 76px 58px, 94px 72px, 118px 86px;
}

main {
  width: min(100vw, calc(100vh * 1.775));
  width: min(100dvw, calc(100dvh * 1.775));
  aspect-ratio: 568 / 320;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

canvas {
  width: 100%;
  height: 100%;
  background: #000;
  image-rendering: pixelated;
  outline: none;
  touch-action: none;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 0.28s linear;
}

#loading-track {
  width: min(62vw, 360px);
  height: 10px;
  padding: 2px;
  border: 2px solid #fff;
  background: #000;
}

#loading-progress {
  width: 8%;
  height: 100%;
  background: #fff;
  transition: width 0.12s linear;
}

#mobile-controls {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

.mobile-left,
.mobile-jump,
.mobile-pause {
  position: fixed;
  pointer-events: auto;
}

.mobile-left {
  left: max(10px, env(safe-area-inset-left));
  bottom: max(58px, calc(env(safe-area-inset-bottom) + 42px));
  display: flex;
  gap: 10px;
}

.mobile-jump {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(58px, calc(env(safe-area-inset-bottom) + 42px));
}

.mobile-pause {
  left: 50%;
  bottom: max(54px, calc(env(safe-area-inset-bottom) + 40px));
  transform: translateX(-50%);
}

.mobile-btn {
  appearance: none;
  -webkit-appearance: none;
  width: clamp(52px, 11vmin, 74px);
  height: clamp(48px, 10vmin, 68px);
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0.58;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-pause {
  width: clamp(40px, 7vmin, 48px);
  height: clamp(40px, 7vmin, 48px);
}

.mobile-btn:active {
  opacity: 0.72;
  transform: scale(0.96);
}

.mobile-pause:active {
  transform: translateX(-50%) scale(0.96);
}

.mobile-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

body.mobile-platform.mobile-controls-visible #mobile-controls {
  display: block;
}
