/* Shared generating panel — same layout on every feature page.
 *
 * IMPORTANT: generating GIF size is locked here ONLY.
 * Do NOT re-declare .ps-generating img / .ps-generating-mark width/height
 * in page <style> blocks (those 52px overrides keep shrinking it).
 */
:root {
  /* 顶栏 Pixel Forge logo=32px；过场取 3×，和品牌对齐又不会抢标题 */
  --ps-generating-mark-size: 96px;
}

.ps-setup-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 32px;
}

.ps-generating {
  min-height: 420px;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Single source of truth — !important beats page-local 52/66/68px regressions */
.ps-generating .ps-generating-mark,
.ps-generating > img.ps-generating-mark,
.ps-generating > img[src*="pixelsprite-generating"],
.ps-generating img[src*="pixelsprite-generating"],
.fx-generating img[src*="pixelsprite-generating"],
.sa-generating img[src*="pixelsprite-generating"],
.scene-generating img[src*="pixelsprite-generating"],
.pp-generating img[src*="pixelsprite-generating"],
.card.loading img[src*="pixelsprite-generating"] {
  width: var(--ps-generating-mark-size) !important;
  height: var(--ps-generating-mark-size) !important;
  min-width: var(--ps-generating-mark-size) !important;
  min-height: var(--ps-generating-mark-size) !important;
  max-width: var(--ps-generating-mark-size) !important;
  max-height: var(--ps-generating-mark-size) !important;
  flex: 0 0 var(--ps-generating-mark-size) !important;
  box-sizing: content-box !important;
  object-fit: contain !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
  margin: 0 0 18px !important;
  border: 0 !important;
  padding: 0 !important;
  display: block !important;
}

.ps-generating .ps-title {
  margin-bottom: 7px;
}

.ps-generating .ps-desc {
  margin-bottom: 28px;
}

.ps-generating .ps-progress {
  width: 100%;
  max-width: 560px;
  margin: 0 0 18px;
  text-align: left;
}

.ps-progress-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ps-muted, #766f66);
  font-size: 13px;
}

.ps-progress-heading b {
  color: var(--ps-accent, #c9633f);
  font-weight: 600;
}

.ps-progress-line {
  height: 15px;
  background: #ebe6de;
  border-radius: 999px;
  overflow: hidden;
}

.ps-progress-fill {
  height: 100%;
  width: 0;
  background: var(--ps-accent, #c9633f);
  border-radius: 999px;
  transition: width 0.45s ease;
  position: relative;
  /* 流光只允许画在已填充段；否则 translateX 会溢到空轨 */
  overflow: hidden;
}

.ps-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  animation: psShimmer 1.5s infinite;
}

@keyframes psShimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.ps-generating .ps-status {
  width: 100%;
  max-width: 560px;
  display: grid;
  gap: 11px;
  color: #847c73;
  font-size: 13px;
  text-align: left;
}

.ps-generating .ps-status div.active,
.ps-generating .ps-status div.done {
  color: #49423b;
}

.ps-generating .ps-status div.done::before {
  content: "✓";
  color: #fff;
  background: var(--ps-accent, #c9633f);
  border-radius: 50%;
  font-size: 10px;
  padding: 1px 4px;
  margin-right: 8px;
}

.ps-generating .ps-status div:not(.done)::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d9d4cc;
  vertical-align: -3px;
  margin-right: 9px;
}

/* ── Floor sheen（生成中：砖块地面溜光，可复用） ─────────
 * 挂在相对定位容器上；用 mask-image 限制到地面格（可选）。
 * 开：加 .is-on；关：去掉 .is-on。
 */
.ps-floor-sheen {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: rgba(8, 10, 16, 0.28);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.ps-floor-sheen.is-on {
  opacity: 1;
}
.ps-floor-sheen::before,
.ps-floor-sheen::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(
    112deg,
    transparent 38%,
    rgba(255, 214, 160, 0.06) 44%,
    rgba(255, 236, 210, 0.55) 50%,
    rgba(255, 176, 96, 0.18) 54%,
    transparent 62%
  );
  transform: translateX(-35%);
}
.ps-floor-sheen.is-on::before {
  animation: psFloorSheen 1.55s linear infinite;
}
.ps-floor-sheen.is-on::after {
  background: linear-gradient(
    112deg,
    transparent 42%,
    rgba(255, 255, 255, 0.12) 49%,
    transparent 56%
  );
  animation: psFloorSheen 1.55s linear infinite;
  animation-delay: 0.28s;
  opacity: 0.85;
}
@keyframes psFloorSheen {
  from { transform: translateX(-42%); }
  to { transform: translateX(42%); }
}
@media (prefers-reduced-motion: reduce) {
  .ps-floor-sheen.is-on::before,
  .ps-floor-sheen.is-on::after {
    animation: none;
    transform: translateX(0);
    opacity: 0.35;
  }
}
