/*
 * Safe-area insets keep the interface out of the status bar, camera cutout
 * and home indicator on phones. Browsers and modern WebViews fill these from
 * env() once viewport-fit=cover is set on the viewport meta tag. A native
 * wrapper app on an older Android WebView, where env() reports zero, can set
 * the same properties itself from the system insets, for example:
 *   document.documentElement.style.setProperty('--safe-area-inset-top', '24px');
 * Inline values on the root element win over the defaults below.
 */
:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

html, body {
  height: 100%;
}

/*
 * The insets are reserved on the body, which never scrolls, so the strip
 * under the status bar stays clear no matter how far a page scrolls. The
 * root element is the scroll container instead.
 */
body {
  margin: 0;
  padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
  box-sizing: border-box;
  overflow: hidden;
}

canvas {
  outline: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: auto;
}
