html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1f1f1f;
  -ms-touch-action: none;
}

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

body {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  color: #888;
  background: #1f1f1f;
  font-family: Helvetica, Verdana, Arial, sans-serif;
  text-align: center;
  cursor: default;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

html[data-viewport-layout='fixed'] body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

html[data-viewport-layout='fixed'] #GameDiv {
  width: min(
    calc(100vw - var(--safe-left) - var(--safe-right)),
    calc((100vh - var(--safe-top) - var(--safe-bottom)) * 430 / 932),
    430px
  );
  width: min(
    calc(100vw - var(--safe-left) - var(--safe-right)),
    calc((100dvh - var(--safe-top) - var(--safe-bottom)) * 430 / 932),
    430px
  );
  height: min(
    calc(100vh - var(--safe-top) - var(--safe-bottom)),
    calc((100vw - var(--safe-left) - var(--safe-right)) * 932 / 430),
    932px
  );
  height: min(
    calc(100dvh - var(--safe-top) - var(--safe-bottom)),
    calc((100vw - var(--safe-left) - var(--safe-right)) * 932 / 430),
    932px
  );
  max-width: 430px;
  max-height: 932px;
}

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

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