/* ==========================================================================
   quipaye.css — Styles du module Qui Paye
   Animation signature : spotlight + roulette + confettis
   Le module garde un theme sombre pour l'effet dramatique
   ========================================================================== */

/* --------------------------------------------------------------------------
   Interface principale
   -------------------------------------------------------------------------- */
.quipaye {
  text-align: center;
  position: relative;
}

.quipaye__desc {
  margin-bottom: var(--space-xl);
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Liste des membres
   -------------------------------------------------------------------------- */
.quipaye__members {
  margin-bottom: var(--space-lg);
  text-align: left;
}

.quipaye__members-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.quipaye__member {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text);
}

.quipaye__member-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  line-height: 1;
  padding: 0 2px;
  transition: color var(--transition-fast);
}

.quipaye__member-remove:hover {
  color: var(--error);
}

.quipaye__add-member {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.quipaye__add-member .input {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Scene d'animation (fond sombre pour le drame)
   -------------------------------------------------------------------------- */
.quipaye__stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background-color: #0F172A;
}

.quipaye__stage--blackout {
  background-color: #000;
  animation: quipayeBlackout 500ms ease forwards;
}

@keyframes quipayeBlackout {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Spotlight — lueur indigo/corail
   -------------------------------------------------------------------------- */
.quipaye__stage--spotlight {
  background: radial-gradient(
    circle 0px at 50% 50%,
    rgba(99, 102, 241, 0.1) 0%,
    #0F172A 100%
  );
  animation: quipayeSpotlight 800ms ease forwards;
}

@keyframes quipayeSpotlight {
  from {
    background: radial-gradient(
      circle 0px at 50% 50%,
      rgba(99, 102, 241, 0.1) 0%,
      #000 0%
    );
  }
  to {
    background: radial-gradient(
      circle 300px at 50% 50%,
      rgba(99, 102, 241, 0.1) 0%,
      #0F172A 100%
    );
  }
}

.quipaye__spotlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.quipaye__spotlight--active {
  background: radial-gradient(
    circle 300px at 50% 45%,
    rgba(99, 102, 241, 0.08) 0%,
    transparent 100%
  );
}

/* --------------------------------------------------------------------------
   Roulette des noms
   -------------------------------------------------------------------------- */
.quipaye__roulette {
  position: relative;
  z-index: 2;
}

.quipaye__roulette-name {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--text-5xl);
  color: #F1F5F9;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
  transition: transform 50ms ease;
}

.quipaye__roulette-name--final {
  color: var(--coral);
  text-shadow: 0 0 60px rgba(255, 107, 107, 0.4);
}

/* --------------------------------------------------------------------------
   Resultat final
   -------------------------------------------------------------------------- */
.quipaye__result {
  position: relative;
  z-index: 2;
  text-align: center;
}

.quipaye__result-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-2xl);
  color: rgba(241, 245, 249, 0.6);
  margin-bottom: var(--space-md);
  animation: fadeIn 300ms ease forwards;
}

.quipaye__result-name {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 6rem);
  color: var(--coral);
  letter-spacing: -0.02em;
  text-shadow:
    0 0 40px rgba(255, 107, 107, 0.3),
    0 0 80px rgba(255, 107, 107, 0.15);
  margin-bottom: var(--space-sm);
}

.quipaye__result-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-xl);
  color: rgba(241, 245, 249, 0.5);
  margin-bottom: var(--space-2xl);
}

.quipaye__result-btn {
  opacity: 0;
  animation: fadeInUp 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --------------------------------------------------------------------------
   Canvas confettis
   -------------------------------------------------------------------------- */
.quipaye__confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .quipaye__roulette-name {
    font-size: var(--text-6xl);
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .quipaye__stage--blackout,
  .quipaye__stage--spotlight,
  .quipaye__result-label,
  .quipaye__result-btn {
    animation: none;
    opacity: 1;
  }
}
