/* The page around the app (ADR 0052): the app draws itself on a canvas that fills the window. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

/* The app stays inside the safe areas (a notch, the home indicator) and above the on-screen keyboard: viewport.js sets
   the visible part of the page where the browser does not shrink the page for the keyboard (Safari). */
#out {
  position: fixed;
  top: calc(var(--viewport-top, 0px) + env(safe-area-inset-top, 0px));
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  height: calc(var(--viewport-height, 100%) - env(safe-area-inset-top, 0px) - var(--bottom-inset, env(safe-area-inset-bottom, 0px)));
}

/* Shown while the app loads; removed when it starts. */
#splash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-family: system-ui, sans-serif;
}

#splash .bar {
  width: 160px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(190, 18, 60, 0.2);
}

#splash .bar div {
  width: 40%;
  height: 100%;
  background: #be123c;
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

@media (prefers-color-scheme: dark) {
  html, body {
    background: #202020;
  }
}
