body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }

/* Modal background and spinner area */
.spinner-visual {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  min-height:96px;
  padding:10px;
  border-radius:12px;
  position:relative;
  overflow:hidden;
  background: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.06), transparent 10%),
              linear-gradient(120deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  backdrop-filter: blur(2px);
}

.spinner-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(60deg, rgba(255,82,82,0.06), rgba(255,183,77,0.06), rgba(124,77,255,0.06));
  animation: slow-rotate 8s linear infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.flicker-item {
  padding:8px 14px;
  border-radius:999px;
  font-weight:700;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15), inset 0 -4px 10px rgba(0,0,0,0.06);
  transform: translateY(0) rotate(0deg);
  transition: transform .22s ease, opacity .18s ease;
  will-change: transform, opacity;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

/* person chip variant for larger, more readable names */
.person-chip { padding:12px 18px; font-size:1rem; border-radius:14px; }

/* several colorful gradient presets; JS will pick one at random */
.g1 { background: linear-gradient(90deg,#ff5f6d,#ffc371); }
.g2 { background: linear-gradient(90deg,#36d1dc,#5b86e5); }
.g3 { background: linear-gradient(90deg,#ff7eb3,#65d6ff); }
.g4 { background: linear-gradient(90deg,#8e2de2,#4a00e0); }
.g5 { background: linear-gradient(90deg,#f77062,#fe5196); }
.g6 { background: linear-gradient(90deg,#43e97b,#38f9d7); }

/* Ensure good contrast for text on each gradient */
/* g1: warm (light) -> use dark text */
.flicker-item.g1, .final-card.g1 { color: #111; text-shadow: none; }
/* g2: cyan/blue -> use light text */
.flicker-item.g2, .final-card.g2 { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.45); }
/* g3: pink/light-blue -> use dark text for readability on lighter tones */
.flicker-item.g3, .final-card.g3 { color: #111; text-shadow: none; }
/* g4: deep purple -> use light text */
.flicker-item.g4, .final-card.g4 { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.45); }
/* g5: warm pink/orange -> dark text */
.flicker-item.g5, .final-card.g5 { color: #111; text-shadow: none; }
/* g6: green/cyan -> dark text */
.flicker-item.g6, .final-card.g6 { color: #111; text-shadow: none; }

/* subtle pulsing + lift */
@keyframes pulse {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-6px) scale(1.03); }
}

@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* final pick styling */
.modal-body h3 { font-size:1.65rem; margin-bottom:.25rem; color:#111; }
.modal-body p.lead { font-size:1.15rem; color:#333; }

/* confetti particles */
.confetti {
  position: absolute;
  width: 10px;
  height: 14px;
  opacity: 0.95;
  border-radius: 2px;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity:1 }
  100% { transform: translateY(160px) rotate(720deg); opacity:0 }
}

/* results area */
#results .alert { margin-bottom:8px; }

@media (prefers-reduced-motion: reduce) {
  .flicker-item, .spinner-visual::before { animation: none !important; }
  .confetti { animation: none !important; }
}

/* final pick animated card */
.final-card {
  display:inline-block;
  padding:14px 20px;
  border-radius:12px;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  transform-origin: center;
  opacity: 0;
  transform: scale(.9) translateY(8px);
  transition: transform .35s cubic-bezier(.2,.9,.2,1), opacity .28s ease;
}
.final-card.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.final-person { font-weight:800; font-size:1.35rem; text-shadow:0 4px 20px rgba(0,0,0,0.35); }
.final-topic { font-size:1.05rem; opacity:.95; }
