/**
 * @NOTE - This CSS is included in all pages (main app, failed-to-load-app.html,
 * no-storage.html) so ensure that there is no conflict with styles used in the
 * main app. Use .initial-x namespacing on class names.
 */

:root {
  /**
   * @NOTE - Do not use system-ui as it causes problems when devices use a font
   * for languages such as Simplified Chinese. See:
   * https://infinnie.github.io/blog/2017/systemui.html
   * https://github.com/twbs/bootstrap/pull/22377
   *
   * @NOTE - These variables are used throughout the app. Be careful!
   */
  --fontFamily: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --monospaceFontFamily: ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
}

body {
  font-family: var(--fontFamily);
  font-size: 1rem;
  padding: 0;
  margin: 0;
  /* In light mode this makes the text appear less heavy */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dark {
  /* "auto" results in easier-to-read text in dark mode  */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto; 
}

button,
input,
select {
  /* By default form elements do not inherit the parent's font-family */
  font-family: inherit;
}

img {
  border: none;
}

.initial-wrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

.initial-content {
  width: 800px;
  max-width: 80%;
  margin: 0 auto;
  text-align: center;
}

.initial-overlay {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  text-align: center;
  padding: 30px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

noscript .initial-overlay {
  background-color: #c7d306;
  z-index: 2;
}

.initial-warning {
  text-align: center;
  margin-bottom: 1rem;
}

.initial-spinner {
  animation: initial-spinner 1.5s linear infinite;
  fill: transparent;
  filter: none;
  stroke: rgba(0, 0, 0, 0.5);
  stroke-width: 4px;
  pointer-events: none;
}

.initial-spinner:not(.hidden) ~ * {
  display: none;
}

@keyframes initial-spinner {
  0% {
    stroke-dasharray: 0 100;
    stroke-dashoffset: 25;
  }
  25% {
    stroke-dasharray: 75 25;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 0 100;
    stroke-dashoffset: -125;
  }
  75% {
    stroke-dasharray: 75 25;
    stroke-dashoffset: -150;
  }
  100% {
    stroke-dasharray: 0 100;
    stroke-dashoffset: -275;
  }
}
