/*
 * Page shell for the web build.
 *
 * The stock template pins the game to a fixed box with a rounded border and
 * page furniture around it. This replaces that with a frame that fills the
 * browser window while holding the 16:9 of the 2560x1440 design resolution, so
 * the game letterboxes against the surrounding colour instead of stretching.
 * `!important` is required because the generated markup sets the frame size as
 * an inline style on #GameDiv.
 *
 * image-rendering: pixelated matters as much as the engine-side filter setting:
 * without it the browser resamples the upscaled canvas bilinearly and undoes
 * the point filtering at the very last step.
 */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background-color: #05070c;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-family: Helvetica, Verdana, Arial, sans-serif;
}

body, canvas, div {
  outline: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Page furniture from the stock template. */
.header, .footer { display: none !important; }

#GameDiv {
  /* 16:9, as large as fits. */
  width: min(100vw, calc(100vh * 16 / 9)) !important;
  height: min(100vh, calc(100vw * 9 / 16)) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
}

#Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
}

#GameCanvas {
  display: block;
  background-color: rgba(0, 0, 0, 0);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}
