/* Planner Recovery Phase 1 — preview/camera presentation only. */

body[data-recovery-phase1="true"] .player-anchor {
  --phase1-preview-display-size: 128px;
  --phase1-preview-display-width: 128px;
  --phase1-preview-display-height: 128px;
  --phase1-identity-anchor-x: 50%;
  --phase1-identity-anchor-y: 37.5%;
  position: relative;
  display: grid !important;
  width: var(--phase1-preview-display-width);
  height: var(--phase1-preview-display-height);
  min-width: 0;
  min-height: 0;
  place-items: center;
  gap: 0;
  isolation: isolate;
}

body[data-recovery-phase1="true"] #playerCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--phase1-preview-display-width);
  height: var(--phase1-preview-display-height);
  max-width: calc(100vw - 16px);
  max-height: calc(100vw - 16px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* The GrowID is anchored to the canonical Player frame inside the fixed
   camera. It is intentionally independent from pets, Wings and effect bounds. */
body[data-recovery-phase1="true"] .player-anchor > .phase14-identity-stage {
  position: absolute;
  z-index: 3;
  top: var(--phase1-identity-anchor-y);
  left: var(--phase1-identity-anchor-x);
  width: min(1120px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  margin: 0;
  transform: translate(-50%, calc(-100% - 12px)) scale(0.94) !important;
  pointer-events: none;
}

body[data-recovery-phase1="true"] .player-anchor > .loading-label {
  z-index: 4;
}

/* The legacy renderer diagnostic sat immediately above the inventory drawer.
   A responsive preview can occupy that same transparent canvas area, so
   keep the diagnostic below the top bar and outside every authored sprite. */
body[data-recovery-phase1="true"] .renderer-status {
  top: 50px;
  bottom: auto;
}

@media (max-width: 680px) {
  body[data-recovery-phase1="true"] .player-anchor > .phase14-identity-stage {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    transform: translate(-50%, calc(-100% - 10px)) scale(0.94) !important;
  }
}

@media (min-width: 681px) {
  body[data-recovery-phase1="true"] .player-anchor {
    min-width: 384px;
    min-height: 216px;
  }
}
