/* === Loader sizing knobs (match UXML) === */
:root {
  --logo-bar-h-frac: 0.09;
  /* 10% of frame height */
  --logo-inbar-h: 0.56;
  /* 70% of bar height */
  --logo-max-w-frac: 0.31;
  /* 46% of frame width */
  --motif-h-frac: 0.40;
  /* 50% of frame height (your request) */
  --motif-aspect: 220/140;
  /* keep art aspect (adjust if different) */
}

/* Fullscreen overlay; center a "phone frame" inside */
#loadingPage {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  /* JS switches to flex */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.0);
  /* transparent outside the frame */
}

/* The frame matches the Unity canvas area (JS sets its size).
   Background path is relative to THIS CSS file -> TemplateData/,
   hence ../Assets/... */
#loadingFrame {
  position: relative;
  width: var(--frameW, 360px);
  height: var(--frameH, 640px);
  background: url('../Assets/Background.jpg') center/cover no-repeat;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  /* optional */
}

#loadingLogoBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--frameH, 640px) * var(--logo-bar-h-frac));
  display: flex;
  align-items: center;
  /* center vertically */
  justify-content: center;
  /* center horizontally */
}

#loadingLogo {
  max-width: 31%;
  /* â¬… like UXML width setting */
  max-height: 56%;
  /* â¬… like UXML height setting */
  width: auto;
  height: auto;
  object-fit: contain;
  /* scale-to-fit */
}

/* Center block (motif + text) vertically & horizontally */
#loadingCenter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #083970;
  user-select: none;
}

/* container = 50% of frame height, fixed aspect */
.loading-glyph {
  position: relative;
  height: calc(var(--frameH, 800px) * var(--motif-h-frac));
  /* 50% */
  aspect-ratio: var(--motif-aspect);
  margin: 0 auto 12px;
  contain: paint;
}

.loading-glyph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 97%;
  object-fit: contain;
  pointer-events: none;
}

/* faint background */
.glyph-inactive {
  opacity: .35;
  z-index: 10;
}

/* active stays full size; clipped from top -> reveals bottom->top */
.glyph-active {
  --fill: 0%;
  clip-path: inset(calc(100% - var(--fill)) 0 0 0);
  will-change: clip-path;
  transition: clip-path .12s linear;
  z-index: 10;
  transform: translateY(1.5%) scale(1.01);
  transform-origin: center center;
}



/* Progress text (no bar) */
.loading-text {
  font-family: 'DIN-Black', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .5px;
  font-size: clamp(16px, 3.6vw, 22px);
  color: #083970;
  text-shadow: none;
}

/* Big %; scales with the loader frame height */
.loading-text .percent {
  display: block;
  font-size: calc(var(--frameH, 640px) * 0.07);
  /* 7% of frame height */
  /* keep layout stable when it becomes 100% */
  min-width: 4ch;
  text-align: center;
}

/* Smaller label below */
.loading-text .label {
  display: block;
  font-size: calc(var(--frameH, 640px) * 0.025);
  /* ~2.5% of frame height */
  letter-spacing: 0.06em;
}
