/* Loading screens use the HUD's ivory type and fine white rules. */
#loader,
#match-loading {
  --loading-white: #f2f2ef;
  --loading-gray: #c2c5c3;
}

#loader .loader-city,
#match-loading .loading-art {
  background: none;
  animation: none;
  filter: none;
}

.loader-city > img,
.loading-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loader-city > img {
  object-position: 50% 43%;
}

.loader-city::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #090e13ed, #10192370 48%, #111b2547);
}

.loading-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0a1119f5 5%, #0e182477 75%, #12212e22);
}

#loader .start-button {
  position: relative;
  margin: 30px auto 0;
  min-width: 230px;
  min-height: 50px;
  padding: 13px 23px;
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--loading-white);
  background: linear-gradient(
    90deg,
    #20232800,
    #202328b8 17%,
    #202328b8 83%,
    #20232800
  );
  border: 0;
  border-top: 1px solid #f2f2ef66;
  border-bottom: 1px solid #f2f2ef33;
  border-radius: 0;
  font:
    500 19px/1.1 Barlow,
    sans-serif;
  letter-spacing: 0.13em;
  text-shadow: 0 1px 3px #0008;
  transition:
    background 0.18s,
    border-color 0.18s,
    opacity 0.18s;
}

#loader .start-button:not(:disabled):hover,
#loader .start-button:focus-visible {
  background: #f2f2ef15;
  border-color: var(--loading-white);
  outline: 1px solid #f2f2ef66;
  outline-offset: 5px;
}

#loader .start-button:disabled {
  opacity: 0.48;
  pointer-events: none;
}

#loader .start-dot {
  width: 15px;
  height: 15px;
  border: 1px solid #f2f2efb3;
  border-radius: 0;
  rotate: 45deg;
  background: transparent;
  animation: none;
  box-shadow: none;
}

#loader .start-dot::after {
  width: 5px;
  height: 5px;
  background: var(--loading-white);
  border-radius: 0;
}

#loader .loader-bottom {
  width: min(620px, 84vw);
  bottom: max(6%, env(safe-area-inset-bottom));
}

#loader .loader-progress,
#match-loading .loader-progress {
  height: 7px;
  padding: 1px;
  border: 1px solid #f2f2ef66;
  border-radius: 0;
  box-shadow: none;
  background:
    repeating-linear-gradient(90deg, #f2f2ef0c 0 23px, transparent 23px 26px),
    #13181c88;
}

#loader .loader-progress > div,
#match-loading .loader-progress > div {
  background: #f2f2ef;
  height: 100%;
  box-shadow: none;
  transition: none;
}

#loader .loader-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--loading-gray);
  font:
    500 11px/1.5 Barlow,
    sans-serif;
  letter-spacing: 0.12em;
}

#loader #asset-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

#loader #asset-percent {
  flex: none;
  color: var(--loading-white);
  font:
    500 18px/1 Barlow,
    sans-serif;
  font-variant-numeric: tabular-nums;
}

#loader.stopped .loader-haze {
  animation-play-state: paused;
}

#loader.ready :is(.loader-progress, .loader-meta) {
  opacity: 1;
}

#match-load-label {
  color: var(--loading-gray);
  font-family: Barlow, sans-serif;
  letter-spacing: 0.1em;
}

@media (max-width: 700px) {
  #loader .start-button {
    min-width: 205px;
    font-size: 17px;
    margin-top: 20px;
  }

  #loader .loader-meta {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #loader .start-button {
    margin-top: 9px;
    min-height: 38px;
    padding: 9px 18px;
    font-size: 16px;
  }

  #loader .loader-bottom {
    bottom: max(3%, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  #loader .start-button {
    transition: none;
  }
}
