* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --fade: 400ms; /* overwritten from script.js (FADE_DURATION) */
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000; /* color of the bars around the stage */
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 1920 x 1427 ratio, as large as possible inside the window */
#stage {
  position: relative;
  aspect-ratio: 1920 / 1427;
  width: min(100vw, calc(100vh * 1920 / 1427));
  height: auto;
}

/* All three Rive canvases are stacked on top of each other */
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
  visibility: visible;
  /* fade in */
  transition: opacity var(--fade) ease, visibility 0s linear 0s;
}

.layer.top {
  z-index: 10;
}

/* Fade out, then become invisible (canvas keeps its size while hidden) */
.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: sans-serif;
  font-size: 24px;
  background: #000;
  z-index: 100;
}