/* Loading bar wrapper */

#unity-loading-bar {
  width: min(72vw, 340px);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1000;
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Optional Unity logo */

#unity-logo {
  width: 154px;
  height: 130px;
  margin: 0 auto 22px auto;
  background: url('unity-logo-dark.png') no-repeat center;
  background-size: contain;
  opacity: 0.78;
  filter: sepia(0.45) saturate(1.2) brightness(1.06) contrast(0.95);
}

/* Loading bar outer track */

#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  padding: 2px;

  background:
    linear-gradient(180deg, rgba(255, 152, 72, 0.07), rgba(0, 0, 0, 0.18)),
    rgba(13, 5, 2, 0.54);

  border: 1px solid rgba(255, 156, 76, 0.32);
  border-radius: 999px;

  overflow: hidden;

  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.52),
    0 0 42px rgba(211, 111, 40, 0.16),
    inset 0 1px 0 rgba(255, 226, 190, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.34);
}

/* Loading bar fill */

#unity-progress-bar-full {
  height: 100%;
  width: 0%;

  background: linear-gradient(
    90deg,
    #9f421d 0%,
    #d36f28 42%,
    #f19a4c 72%,
    #ffd39a 100%
  );

  border-radius: 999px;

  box-shadow:
    0 0 20px rgba(226, 132, 56, 0.44),
    0 0 44px rgba(211, 111, 40, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

/* Loading percentage text */

#unity-progress-text {
  position: absolute;
  left: 50%;
  top: calc(50% + 18px);
  z-index: 1000;

  transform: translateX(-50%);
  pointer-events: none;

  color: rgba(250, 222, 190, 0.76);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-align: center;

  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Visibility states */

#unity-loading-bar.visible,
#unity-progress-text.visible {
  opacity: 1;
}

#unity-loading-bar.fade-out,
#unity-progress-text.fade-out,
.fade-out {
  opacity: 0 !important;
}

/* Small screens */

@media screen and (max-width: 520px) {
  #unity-loading-bar {
    width: min(78vw, 300px);
  }

  #unity-progress-text {
    font-size: 11px;
  }
}