/* Shared browser loading screen. Colors follow NomgarPalette. */
#nomgar-loading {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #091c3e;
  z-index: 2;
  opacity: 1;
  transition: opacity 240ms ease-out;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}
#nomgar-loading[hidden] { display: none; }
#nomgar-loading.is-ready { opacity: 0; pointer-events: none; }
.nomgar-loading-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.nomgar-loading-logo {
  position: absolute;
  top: 5.5%;
  left: 10%;
  width: 80%;
  height: auto;
  filter: drop-shadow(0 5px 12px #091c3e80);
}
.nomgar-loading-footer {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 7%;
  color: #fff;
}
.nomgar-loading-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: clamp(12px, 2.3vh, 22px);
  font-weight: 900;
  letter-spacing: .04em;
  text-shadow: 0 2px 2px #091c3e;
}
#nomgar-loading-percent { color: #f9df73; font-variant-numeric: tabular-nums; }
#nomgar-loading-progress {
  box-sizing: border-box;
  height: clamp(18px, 2.5vh, 28px);
  padding: 3px;
  background: #091c3e;
  border: 2px solid #ebbd48;
  border-radius: 10px;
  box-shadow: 0 4px 0 #091c3e99;
}
#nomgar-loading-fill {
  width: 0%;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(180deg, #f9df73, #ebbd48 55%, #d0902d);
  transition: width 160ms linear;
}
#nomgar-loading-retry {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border: 2px solid #091c3e;
  border-radius: 8px;
  background: #58c472;
  color: #091c3e;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
/* Tall phones keep the entire character group in frame. Blend the portrait's
   edges into navy instead of cropping the puppy and pig at either side. */
@media (max-aspect-ratio: 9/17) {
  .nomgar-loading-art {
    top: 50%;
    bottom: auto;
    height: auto;
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 90%, transparent);
    mask-image: linear-gradient(transparent, #000 8%, #000 90%, transparent);
  }
}
#unity-warning { z-index: 3; max-width: 85%; }
@media (prefers-reduced-motion: reduce) {
  #nomgar-loading, #nomgar-loading-fill { transition: none; }
}
