/* loading.css: retained cascade position */ /* Uses the existing alley and logo; the mockup is not downloaded at runtime. */
html:has(body[data-screen='loading']),
body[data-screen='loading'] {
  height: 100%;
  overflow: hidden;
}
#loading-screen[hidden],
#loading-screen [hidden] {
  display: none !important;
}
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: #080c14;
  color: #f4e6c7;
}
#loading-screen:before {
  content: '';
  position: fixed;
  inset: -6px;
  z-index: -2;
  pointer-events: none;
  background: #080c14 var(--art-background) center/cover no-repeat;
  filter: blur(3px) brightness(0.58);
}
#loading-screen:after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, #070b1026 10%, #05070d80 75%, #03050bc7);
}
.loading-content {
  width: min(620px, 100%);
  text-align: center;
  padding-bottom: 2dvh;
}
.loading-brand {
  position: relative;
  width: 100%;
  aspect-ratio: 2/1;
  margin: 0 auto 32px;
  display: grid;
  place-items: center;
}
.loading-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 7px 14px #000a);
}
.loading-wordmark {
  font:
    700 clamp(68px, 8vw, 120px) / 1 Batang,
    serif;
  color: #eaca85;
  letter-spacing: 8px;
  text-shadow: 0 3px 9px #0009;
}
.loading-brand.logo-ready .loading-logo {
  opacity: 1;
}
.loading-brand.logo-ready .loading-wordmark {
  visibility: hidden;
}
.loading-brand > .image-fallback {
  display: none;
}
#loading-title {
  font:
    500 clamp(16px, 1.6vw, 24px) / 1.5 'Malgun Gothic',
    'Apple SD Gothic Neo',
    sans-serif;
  letter-spacing: 0.02em;
  margin: 0 0 22px;
  color: #f3e6c9;
}
.loading-progress {
  height: 7px;
  width: 100%;
  border: 1px solid #98733b;
  border-radius: 5px;
  padding: 1px;
  background: #101013c4;
  overflow: hidden;
  box-shadow: 0 1px 4px #000a;
}
.loading-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #b88735, #e4bc65 75%, #fff0b2);
  box-shadow: 0 0 10px #ecae4680;
}
.loading-progress.indeterminate .loading-progress-fill {
  width: 28%;
  animation: loading-sweep 1.5s ease-in-out infinite alternate;
}
.loading-percent {
  display: block;
  min-height: 25px;
  margin-top: 8px;
  color: #eed58f;
  text-align: right;
  font:
    500 18px/1.4 'Malgun Gothic',
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.loading-error {
  margin: 20px auto 0;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.7;
  color: #edc2af;
  overflow-wrap: anywhere;
}
.loading-error:empty {
  display: none;
}
.loading-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.loading-actions:has(button:not([hidden])) {
  padding-bottom: 8px;
}
.loading-actions button {
  min-height: 46px;
  padding: 10px 22px;
  font-size: 14px;
}
.loading-actions .quiet {
  color: #d5c5a2;
  text-decoration: underline;
  text-underline-offset: 4px;
}
body[data-screen='loading'] #app {
  visibility: hidden;
  pointer-events: none;
}
@keyframes loading-sweep {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(250%);
  }
}
@media (min-width: 901px) and (max-height: 700px) {
  #loading-screen {
    padding: 28px 24px;
  }
  .loading-content {
    width: min(460px, 100%);
  }
  .loading-brand {
    margin-bottom: 22px;
  }
  #loading-title {
    margin-bottom: 17px;
  }
}
@media (max-width: 900px) {
  .loading-content {
    width: min(440px, 74vw);
    padding-bottom: 3dvh;
  }
  .loading-brand {
    margin-bottom: 32px;
  }
  #loading-title {
    font-size: 16px;
    margin-bottom: 20px;
    letter-spacing: 0;
  }
  .loading-percent {
    font-size: 14px;
  }
  .loading-progress {
    height: 6px;
  }
  .loading-error {
    font-size: 13px;
  }
  .loading-actions {
    gap: 8px;
  }
  .loading-actions button {
    padding: 10px 14px;
  }
}
@media (max-height: 500px) {
  #loading-screen {
    padding: 24px;
  }
  .loading-content {
    width: min(360px, 78vw);
    padding-bottom: 0;
  }
  .loading-brand {
    width: 240px;
    max-width: 90%;
    margin-bottom: 14px;
  }
  #loading-title {
    font-size: 16px;
    margin-bottom: 14px;
  }
  .loading-error {
    margin-top: 10px;
  }
  .loading-actions {
    margin-top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-progress.indeterminate .loading-progress-fill {
    animation: none;
    transform: translateX(125%);
  }
}
html[data-reduced='true'] .loading-progress.indeterminate .loading-progress-fill {
  animation: none;
  transform: translateX(125%);
}
