/* ==========================================================================
   Photo souvenir (récompense du Petit guide)
   ========================================================================== */

.photo-mask-stage {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.35), transparent 20%),
    linear-gradient(180deg, #a9dff1 0%, #75b88a 100%);
}

/* Placée ici (et non dans son fichier) pour conserver l'ordre de priorité. */
.puzzle-play,
.arcade-stage,
.metamorph-canvas,
.seek-viewport,
.photo-mask-stage {
  width: calc(100% - 12px);
  margin: 0 auto;
  border: 3px solid #fff;
  border-radius: 16px;
  background-color: #6d7f42;
  box-shadow: none;
}

.photo-mask-video,
.photo-mask-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.photo-mask-preview {
  position: static;
  display: none;
  margin-top: 14px;
  border: 4px solid var(--game-dark-deep);
  border-radius: 20px;
  box-shadow: 5px 6px 0 var(--game-shadow);
  transform: none;
}

.photo-mask-preview.ready {
  display: block;
}

.photo-mask-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(180deg, rgba(20, 53, 46, 0.68), rgba(20, 53, 46, 0.86));
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.photo-mask-placeholder span {
  display: block;
  font-size: 48px;
}

.photo-mask-placeholder.hidden {
  display: none;
}

.photo-mask-badge {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 5;
  padding: 8px 14px;
  border: 4px solid var(--game-dark-deep);
  border-radius: 999px;
  color: #fff;
  background: var(--game-dark);
  box-shadow: 4px 5px 0 var(--game-shadow);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) rotate(-1deg);
  transition: opacity 180ms ease;
}

.photo-mask-status {
  border-radius: 12px;
}

.photo-mask-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.photo-mask-share:disabled {
  opacity: 0.48;
}

.photo-mask-canvas {
  display: none;
}

.photo-mask-card.is-collapsed,
.photo-mask-card.is-revealed {
  padding: 0;
}

.photo-mask-card.is-collapsed::after {
  display: none;
}

.photo-reward-teaser {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  padding: 15px 17px;
  color: #38523a;
  background: linear-gradient(135deg, #fff9e5, #f2edcf);
}

.photo-reward-teaser[hidden],
.photo-reward-content[hidden] {
  display: none;
}

.photo-reward-teaser > span {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff8cf;
  background: linear-gradient(135deg, #e8b42b, #f6d965);
  box-shadow: 0 0 0 3px rgba(255, 224, 117, 0.38), 3px 4px 0 rgba(56, 82, 58, 0.22);
  font-size: 25px;
}

.photo-reward-teaser strong {
  align-self: end;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}

.photo-reward-teaser small {
  align-self: start;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.photo-reward-content {
  padding: 10px 18px 16px;
}

.photo-mask-card.is-revealed .photo-reward-content {
  transform-origin: top center;
  animation: photo-reward-unfold 720ms cubic-bezier(0.22, 0.9, 0.3, 1.08) both;
}

.photo-reward-content > p:not(.eyebrow):not(.photo-mask-status) {
  max-width: calc(100% - 76px);
  margin: 0 0 14px;
  color: #667b41;
  font-weight: 700;
  line-height: 1.45;
}

.photo-victory-mask {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 4;
  width: 78%;
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 5px 6px rgba(13, 44, 35, 0.28));
  transform: translate(-50%, -50%);
  transform-origin: center center;
  transition: left 85ms linear, top 85ms linear, width 85ms linear, transform 85ms linear, opacity 140ms ease;
  will-change: left, top, width, transform;
  pointer-events: none;
}

.photo-mask-card.is-camera-active .photo-victory-mask.is-face-tracked {
  opacity: 1;
}

.photo-mask-card.is-camera-active .photo-mask-badge {
  opacity: 1;
}

.photo-mask-card button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.photo-mask-card.is-perfect {
  background: linear-gradient(#fff8df, #fff8df) padding-box,
    linear-gradient(135deg, #fff1a2 0%, #e0aa20 34%, #fff4af 60%, #a97412 100%) border-box;
  box-shadow: 0 0 20px rgba(234, 184, 45, 0.38),
    0 12px 28px rgba(73, 63, 24, 0.14);
}

.photo-mask-card.is-perfect .photo-mask-badge {
  color: #173d34;
  background: linear-gradient(135deg, #fff3a6, #e6b326 52%, #fff0a0);
  box-shadow: 0 0 16px rgba(255, 210, 64, 0.65), 4px 5px 0 var(--game-shadow);
}

@keyframes photo-reward-unfold {
  0% {
    opacity: 0;
    transform: translateY(-18px) scaleY(0.78);
  }
  62% {
    opacity: 1;
    transform: translateY(4px) scaleY(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}
