/* === DietPilot Full-Screen Frameless 8-Bit Loading Screen (v7) === */
html.dp-splash-lock,
html.dp-splash-lock body {
  overflow: hidden;
}

.dp-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4.5vh, 38px);
  padding: clamp(24px, 6vw, 48px);
  background-color: #f6f3ea;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(146, 224, 68, .15) 0%, rgba(32, 92, 76, .04) 48%, rgba(15, 56, 31, .06) 100%),
    linear-gradient(90deg, rgba(28, 84, 58, .038) 1px, transparent 1px),
    linear-gradient(rgba(28, 84, 58, .038) 1px, transparent 1px);
  background-size: 100% 100%, 16px 16px, 16px 16px;
  overflow: hidden;
  cursor: wait;
  user-select: none;
  touch-action: none;
}

.dp-splash-stage {
  inline-size: min(324px, 84vw);
  block-size: min(324px, 84vw);
  display: grid;
  place-items: center;
  margin-block-start: -2vh;
  animation: dpSplashIn 240ms steps(4, end) both;
}

.dp-splash-sprite {
  inline-size: 100%;
  block-size: 100%;
  background-image: url("/logo-cinch-sprite.webp?v=7");
  background-repeat: no-repeat;
  background-size: 800% 700%;
  background-position: 0% 0%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 10px 18px rgba(15, 56, 31, .08));
}

.dp-splash-progress {
  display: grid;
  gap: 12px;
  inline-size: min(312px, 82vw);
  animation: dpSplashIn 260ms steps(4, end) both;
}

.dp-splash-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dp-splash-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #365245;
  line-height: 1.4;
  text-align: start;
}

.dp-splash-pct {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 88px;
  min-block-size: 32px;
  padding: 5px 10px;
  background: #0f381f;
  border: 3px solid #092313;
  box-shadow: 3px 3px 0 rgba(15, 56, 31, .2);
  direction: ltr;
  flex: 0 0 auto;
}

.dp-px-pct-svg {
  display: block;
  block-size: 18px;
  inline-size: auto;
  shape-rendering: crispEdges;
}

.dp-sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dp-splash-bar {
  position: relative;
  direction: ltr;
  inline-size: 100%;
  block-size: 28px;
  padding: 4px;
  border: 3px solid #0f381f;
  background: #eae4d0;
  box-shadow:
    inset 3px 3px 0 #d5ceb7,
    4px 4px 0 rgba(15, 56, 31, .18);
  overflow: hidden;
}

.dp-splash-fill {
  display: block;
  inline-size: 0%;
  block-size: 100%;
  background-color: #2d8a34;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 12px, #eae4d0 12px 15px),
    linear-gradient(180deg, #c2f554 0 4px, #42ad3a 4px 12px, #175424 12px 100%);
  box-shadow: inset -5px 0 0 #f5c11e;
}

.dp-splash.is-complete .dp-splash-fill {
  box-shadow: none;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 12px, #d8ecc6 12px 15px),
    linear-gradient(180deg, #dcff78 0 4px, #56c440 4px 12px, #1b662b 12px 100%);
}

.dp-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms steps(4, end), visibility 280ms steps(4, end);
}

.dp-splash.is-instant {
  transition: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes dpSplashIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .dp-splash-stage,
  .dp-splash-progress {
    animation: none;
  }
  .dp-splash.is-leaving {
    transition-duration: 100ms;
  }
}
