/* Révélation magique — catégorie Butin */
.artifact-reveal-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.artifact-reveal-root.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.artifact-reveal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(0, 245, 212, 0.12), transparent 55%),
    rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(6px);
}

.artifact-reveal-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: min(92vw, 22rem);
  transform: scale(0.72);
  opacity: 0;
}

.artifact-reveal-root.is-open .artifact-reveal-stage {
  animation: artifact-reveal-pop 0.85s cubic-bezier(0.22, 1.15, 0.36, 1) forwards;
}

@keyframes artifact-reveal-pop {
  0% { transform: scale(0.35) rotate(-8deg); opacity: 0; filter: blur(6px); }
  55% { transform: scale(1.06) rotate(2deg); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.artifact-reveal-burst {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.75rem 0 0 -2.75rem;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 228, 64, 0.35) 0%, rgba(168, 85, 247, 0.15) 40%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.artifact-reveal-root.is-open .artifact-reveal-burst {
  animation: artifact-reveal-burst 1.1s ease-out 0.05s forwards;
}

@keyframes artifact-reveal-burst {
  0% { transform: scale(0.2); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.artifact-reveal-frame-wrap {
  position: relative;
  width: min(92vw, 28rem);
  aspect-ratio: 1024 / 512;
  filter: drop-shadow(0 0 28px rgba(0, 245, 212, 0.45));
}

.artifact-reveal-frame-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  animation: artifact-reveal-frame-glow 2.4s ease-in-out infinite;
}

@keyframes artifact-reveal-frame-glow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 8px rgba(0, 245, 212, 0.35)); }
  50% { filter: brightness(1.08) drop-shadow(0 0 14px rgba(254, 228, 64, 0.5)); }
}

.artifact-reveal-logo-wrap {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 26%;
  max-width: 7.25rem;
  aspect-ratio: 1;
  z-index: 3;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.artifact-reveal-logo,
.artifact-reveal-logo-emoji {
  position: relative;
  z-index: 1;
}

.artifact-reveal-root.is-open .artifact-reveal-logo-wrap {
  animation: artifact-reveal-logo-in 0.75s cubic-bezier(0.22, 1.1, 0.36, 1) 0.35s forwards;
}

@keyframes artifact-reveal-logo-in {
  0% { transform: translate(-50%, -50%) scale(0.15) rotate(-20deg); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1.08) rotate(4deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.artifact-reveal-logo,
.artifact-reveal-logo--fill {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  image-rendering: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
  mix-blend-mode: normal;
}

.artifact-reveal-logo-wrap .artifact-reveal-logo-emoji {
  font-size: clamp(2rem, 9vw, 3.5rem);
  line-height: 1;
}

/* Butin — cadre fourni (fond noir conservé) */
.artifact-reveal-root--butin .artifact-reveal-frame-wrap {
  width: min(94vw, 27.5rem);
  aspect-ratio: 707 / 353;
}

.artifact-reveal-root--butin .artifact-reveal-frame-img {
  object-fit: contain;
  object-position: center center;
}

.artifact-reveal-root--butin .artifact-reveal-logo-wrap,
.artifact-reveal-root--butin .artifact-reveal-burst {
  top: 75%;
}

/* Trou noir sous « BUTIN DU NAVIRE » — reste dans le carré cyan */
.artifact-reveal-root--butin .artifact-reveal-logo-wrap {
  width: 18.9%;
  aspect-ratio: 1;
  max-width: none;
  max-height: none;
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.artifact-reveal-root--butin.is-open .artifact-reveal-logo-wrap {
  animation: artifact-reveal-logo-in-butin 0.75s cubic-bezier(0.22, 1.1, 0.36, 1) 0.35s forwards;
}

@keyframes artifact-reveal-logo-in-butin {
  0% { transform: translate(-50%, -50%) scale(0.15) rotate(-20deg); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1) rotate(4deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.artifact-reveal-root--butin .artifact-reveal-logo-wrap .artifact-reveal-logo,
.artifact-reveal-root--butin .artifact-reveal-logo-wrap .artifact-reveal-logo--fill {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

/* Jeu */
.artifact-reveal-root--jeu .artifact-reveal-frame-wrap {
  width: min(96vw, 32rem);
}

/* Événement */
.artifact-reveal-root--evenement .artifact-reveal-frame-wrap {
  width: min(96vw, 32rem);
  filter: drop-shadow(0 0 28px rgba(236, 72, 153, 0.45));
}

.artifact-reveal-root--evenement .artifact-reveal-logo-wrap,
.artifact-reveal-root--evenement .artifact-reveal-burst {
  top: 63%;
}

.artifact-reveal-root--evenement .artifact-reveal-logo-wrap {
  width: 24%;
  max-width: 6.75rem;
}

.artifact-reveal-logo-emoji {
  font-size: clamp(1.4rem, 5.5vw, 2.4rem);
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(254, 228, 64, 0.5));
}

.artifact-reveal-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

.artifact-reveal-sparkles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 8px #f59e0b;
  opacity: 0;
  animation: artifact-reveal-spark 1.4s ease-out forwards;
}

.artifact-reveal-sparkles span:nth-child(1) { left: 18%; top: 52%; animation-delay: 0.5s; }
.artifact-reveal-sparkles span:nth-child(2) { left: 78%; top: 54%; animation-delay: 0.65s; background: #00f5d4; box-shadow: 0 0 8px #00f5d4; }
.artifact-reveal-sparkles span:nth-child(3) { left: 14%; top: 78%; animation-delay: 0.75s; }
.artifact-reveal-sparkles span:nth-child(4) { left: 84%; top: 76%; animation-delay: 0.55s; background: #c084fc; }
.artifact-reveal-sparkles span:nth-child(5) { left: 50%; top: 48%; animation-delay: 0.8s; }
.artifact-reveal-sparkles span:nth-child(6) { left: 32%; top: 82%; animation-delay: 0.7s; background: #00f5d4; }

@keyframes artifact-reveal-spark {
  0% { transform: scale(0); opacity: 0; }
  35% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.2) translateY(-12px); opacity: 0; }
}

.artifact-reveal-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #00f5d4;
  opacity: 0;
  animation: artifact-reveal-text-in 0.5s ease 0.75s forwards;
}

.artifact-reveal-title {
  margin: 0;
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  letter-spacing: 0.06em;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 16px rgba(0, 245, 212, 0.35);
  opacity: 0;
  animation: artifact-reveal-text-in 0.55s ease 0.85s forwards;
}

@keyframes artifact-reveal-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.artifact-reveal-close {
  margin-top: 0.25rem;
  opacity: 0;
  animation: artifact-reveal-text-in 0.5s ease 1s forwards;
}

/* Thème récompense jeu (vert) */
.artifact-reveal-root--jeu .artifact-reveal-backdrop {
  background:
    radial-gradient(circle at 50% 40%, rgba(74, 222, 128, 0.14), transparent 55%),
    rgba(4, 6, 10, 0.88);
}

.artifact-reveal-root--jeu .artifact-reveal-burst {
  background: radial-gradient(circle, rgba(74, 222, 128, 0.5) 0%, rgba(34, 197, 94, 0.22) 35%, transparent 70%);
}

.artifact-reveal-root--jeu .artifact-reveal-frame-wrap {
  filter: drop-shadow(0 0 28px rgba(74, 222, 128, 0.45));
}

.artifact-reveal-root--jeu .artifact-reveal-kicker {
  color: #4ade80;
}

.artifact-reveal-root--jeu .artifact-reveal-title {
  text-shadow: 0 0 16px rgba(74, 222, 128, 0.35);
}

.artifact-reveal-root--jeu .artifact-reveal-sparkles span:nth-child(2),
.artifact-reveal-root--jeu .artifact-reveal-sparkles span:nth-child(6) {
  background: #4ade80;
  box-shadow: 0 0 8px #22c55e;
}

/* Thème récompense événement (rose / violet) */
.artifact-reveal-root--evenement .artifact-reveal-backdrop {
  background:
    radial-gradient(circle at 50% 40%, rgba(244, 114, 182, 0.16), transparent 55%),
    rgba(4, 6, 10, 0.88);
}

.artifact-reveal-root--evenement .artifact-reveal-burst {
  background: radial-gradient(circle, rgba(244, 114, 182, 0.45) 0%, rgba(168, 85, 247, 0.22) 40%, transparent 72%);
}

.artifact-reveal-root--evenement .artifact-reveal-kicker {
  color: #f472b6;
}

.artifact-reveal-root--evenement .artifact-reveal-title {
  text-shadow: 0 0 16px rgba(244, 114, 182, 0.35);
}

.artifact-reveal-root--evenement .artifact-reveal-sparkles span:nth-child(2),
.artifact-reveal-root--evenement .artifact-reveal-sparkles span:nth-child(4),
.artifact-reveal-root--evenement .artifact-reveal-sparkles span:nth-child(6) {
  background: #f472b6;
  box-shadow: 0 0 8px #ec4899;
}

@media (prefers-reduced-motion: reduce) {
  .artifact-reveal-root.is-open .artifact-reveal-stage,
  .artifact-reveal-root.is-open .artifact-reveal-burst,
  .artifact-reveal-root.is-open .artifact-reveal-logo-wrap,
  .artifact-reveal-frame-img,
  .artifact-reveal-sparkles span,
  .artifact-reveal-kicker,
  .artifact-reveal-title,
  .artifact-reveal-close {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .artifact-reveal-root.is-open .artifact-reveal-logo-wrap {
    transform: translate(-50%, -50%) scale(1);
  }

  .artifact-reveal-root--evenement .artifact-reveal-frame-img {
    object-fit: contain;
  }
}
