*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #1a2930;
  background-image: radial-gradient(circle at 50% 42%, #2b4e5a 0%, #17252c 68%, #10191e 100%);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.stage {
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: calc(100dvh - 24px);
  max-width: calc(100vw - 24px);
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  border: 3px solid #4e3542;
  background-color: #4ec0ca;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.14),
    0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  cursor: pointer;
}

@media (max-width: 540px), (max-aspect-ratio: 10 / 16) {
  .stage {
    padding: 0;
  }

  .frame {
    max-height: 100dvh;
    max-width: 100vw;
    width: 100%;
    height: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

@media (max-width: 540px) and (min-aspect-ratio: 9 / 16) {
  .frame {
    width: auto;
    height: 100dvh;
  }
}

html.peek-mode .stage {
  padding: 0;
}

html.peek-mode .frame {
  max-height: 100dvh;
  max-width: 100vw;
  border-radius: 0;
  border-width: 2px;
  box-shadow: none;
}
