:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: #d7f0ec;
  color: #18313a;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 246, 186, 0.75), transparent 28%),
    linear-gradient(135deg, #caebf6 0%, #f8edc8 50%, #d6f1dd 100%);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

#game-shell {
  width: min(100vw, calc(100dvh * 16 / 9), 1120px);
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid rgba(44, 91, 100, 0.22);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(25, 77, 88, 0.24);
  background: #ffffff;
  touch-action: none;
  -webkit-touch-callout: none;
}

@media (max-width: 720px) {
  body {
    place-items: center;
  }

  #game-shell {
    width: min(100vw, calc(100dvh * 16 / 9));
    padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }

  canvas {
    border-radius: 0;
    box-shadow: none;
  }
}

@media (orientation: portrait) and (max-width: 720px) {
  #game-shell {
    width: min(100vw, calc(100dvh * 16 / 9));
  }
}

@media (orientation: landscape) and (max-width: 920px) {
  #game-shell {
    width: min(100vw, calc(100dvh * 16 / 9));
    padding: 0;
  }

  canvas {
    border: 0;
  }
}
