/* Layout: the fixed-size design canvas and SPA screen switching.
   The canvas lives below the fixed .br-header (see header.css), and centers
   as a block in whatever vertical space remains down to the bottom of the
   screen. */
.br-stage-wrap {
  position: fixed;
  top: var(--br-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: transparent;
}
.br-stage-wrap.br-is-portrait {
  position: relative;
  top: auto;
  margin-top: var(--br-header-h);
  width: 100%;
  overflow: visible;
  align-items: center;
  min-height: calc(100vh - var(--br-header-h));
}

.br-stage {
  position: relative;
  width: 1440px;
  height: 850px;
  flex-shrink: 0;
  transform-origin: center center;
}
.br-stage-wrap.br-is-portrait .br-stage {
  transform-origin: center center;
}

.br-screen {
  display: none;
}
.br-screen.br-is-active {
  display: block;
}

/* `translate` (not `transform`) so this composes with each element's own transform: translateX(-50%) centering instead of overriding it. */
.br-screen.br-is-active > * {
  animation: br-child-in .55s ease both;
}
.br-screen.br-is-active > *:nth-child(1) { animation-delay: 0s; }
.br-screen.br-is-active > *:nth-child(2) { animation-delay: .12s; }
.br-screen.br-is-active > *:nth-child(3) { animation-delay: .24s; }
.br-screen.br-is-active > *:nth-child(4) { animation-delay: .36s; }
.br-screen.br-is-active > *:nth-child(5) { animation-delay: .48s; }
.br-screen.br-is-active > *:nth-child(6) { animation-delay: .6s; }
.br-screen.br-is-active > *:nth-child(7) { animation-delay: .72s; }
.br-screen.br-is-active > *:nth-child(8) { animation-delay: .84s; }

@keyframes br-child-in {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .br-screen.br-is-active > * { animation: none; }
}

.br-screen-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
}

.br-screen.br-is-popup {
  position: absolute;
  inset: 0;
  z-index: 40;
}

.br-step-error {
  z-index: 10;
}

@media (max-width: 720px) {
  .br-stage-wrap,
  .br-stage-wrap.br-is-portrait {
    position: static !important;
    inset: auto;
    width: 100%;
    height: auto !important;
    min-height: calc(100vh - var(--br-header-h));
    margin-top: var(--br-header-h);
    overflow: visible;
    background: transparent;
    display: block;
  }
  .br-stage {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 0 auto;
    padding: 20px 20px 24px;
    transform: none !important;
    background: transparent;
    min-height: calc(100vh - var(--br-header-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .br-screen.br-is-active {
    width: 100%;
  }
  .br-screen.br-is-popup-backdrop {
    visibility: hidden;
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .br-stage-wrap.br-is-portrait { align-items: flex-start; }
}
