/* draw-intro.css — Secret Draw intro cinematic
   Slow screen darkening, dice roll-in, suspense text, then hands off.
   window.DrawIntro.show(onComplete)
   v1 */

/* Overlay — starts transparent, darkens over 3s */
.di-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0, 0, 0, 0);
  transition: background 3s ease;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}
.di-overlay.di-dark {
  background: rgba(0, 0, 0, 0.88);
}

/* Skip button — barely visible, top right */
.di-skip {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  transition: color 0.3s ease;
  z-index: 2;
}
.di-skip:hover { color: rgba(255, 255, 255, 0.6); }

/* Ambient particles canvas */
.di-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* The dice — hidden off-screen bottom initially */
.di-dice {
  font-size: clamp(4rem, 15vw, 7rem);
  line-height: 1;
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(120px) rotate(-30deg) scale(0.6);
  transition: none;
  filter: drop-shadow(0 0 0px rgba(251, 146, 60, 0));
  will-change: transform, opacity, filter;
  user-select: none;
}
.di-dice.di-roll-in {
  transition:
    opacity 0.5s ease,
    transform 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.9s ease;
  opacity: 1;
  transform: translateY(0) rotate(0deg) scale(1);
  filter: drop-shadow(0 0 24px rgba(251, 146, 60, 0.7));
}
/* Pulse glow after landing */
.di-dice.di-pulse {
  animation: di-dice-pulse 0.9s ease-in-out 2;
}
@keyframes di-dice-pulse {
  0%   { filter: drop-shadow(0 0 20px rgba(251,146,60,0.6)) drop-shadow(0 0 40px rgba(251,146,60,0.2)); transform: scale(1); }
  50%  { filter: drop-shadow(0 0 50px rgba(251,146,60,1))   drop-shadow(0 0 80px rgba(251,146,60,0.5)); transform: scale(1.08); }
  100% { filter: drop-shadow(0 0 20px rgba(251,146,60,0.6)) drop-shadow(0 0 40px rgba(251,146,60,0.2)); transform: scale(1); }
}

/* Text below dice */
.di-text {
  position: relative;
  z-index: 3;
  margin-top: 28px;
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 700;
  color: #fb923c;
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 2em;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.di-text.di-text-visible {
  opacity: 1;
}
/* Blinking cursor for typewriter */
.di-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #fb923c;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: di-blink 0.7s step-end infinite;
}
@keyframes di-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Small ambient sparkles that drift up during darkening */
.di-spark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: di-spark-rise var(--dur, 3s) ease-out var(--delay, 0s) forwards;
}
@keyframes di-spark-rise {
  0%   { opacity: 0;   transform: translateY(0) scale(1); }
  20%  { opacity: 0.7; }
  100% { opacity: 0;   transform: translateY(-180px) scale(0.3); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .di-overlay       { transition: none !important; }
  .di-dice          { transition: none !important; animation: none !important; }
  .di-dice.di-roll-in { opacity: 1; transform: none; }
  .di-cursor        { animation: none !important; }
  .di-spark         { animation: none !important; }
}
