/* Motion: floating numbers, particles, confetti, toasts, big-win takeover. */

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 700 16px var(--mono);
  color: var(--green);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  animation: float-up 1s cubic-bezier(.2, .8, .3, 1) forwards;
  white-space: nowrap;
}
.float-rare { color: var(--gold); font-size: 15px; letter-spacing: .02em; }
.float-money { color: var(--green); }

@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  18% { opacity: 1; transform: translate(-50%, -60%) scale(1.06); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -170%) scale(1); }
}

.particle {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: particle-fly var(--life, .7s) cubic-bezier(.15, .8, .4, 1) forwards;
}

@keyframes particle-fly {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); }
}

.confetti {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 2s linear forwards;
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: .1; transform: translateY(var(--fall)) rotate(var(--spin)); }
}

.screen-flash {
  position: absolute;
  inset: 0;
  animation: flash-out .45s ease-out forwards;
}

@keyframes flash-out {
  0% { opacity: .85; }
  100% { opacity: 0; }
}

/* --- toasts ---------------------------------------------------------------- */

.toast-layer {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 180;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
  width: min(440px, calc(100vw - 24px));
}

.toast {
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(20, 25, 38, .96);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.3);
  text-align: center;
}
.toast-good { border-color: rgba(73, 201, 122, .5); color: #b6f2cd; }
.toast-bad { border-color: rgba(255, 77, 109, .5); color: #ffc2cd; }
.toast-warn { border-color: rgba(255, 171, 46, .5); color: #ffdca6; }
.toast-out { animation: toast-out .4s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(.96); }
}

/* --- big win --------------------------------------------------------------- */

.bigwin {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  animation: fade-in .25s ease;
}
.bigwin-card {
  padding: 26px 40px;
  border-radius: 18px;
  border: 2px solid var(--bw, var(--gold));
  background: rgba(10, 13, 20, .9);
  box-shadow: 0 0 60px color-mix(in srgb, var(--bw, #ffd166) 40%, transparent);
  text-align: center;
  max-width: min(520px, calc(100vw - 40px));
  animation: bigwin-in .5s cubic-bezier(.15, .9, .25, 1.4);
}
.bigwin-kicker { font: 700 10px var(--mono); letter-spacing: .34em; color: var(--bw, var(--gold)); }
.bigwin-title {
  font: 800 clamp(24px, 5vw, 40px)/1.05 var(--sans);
  margin: 8px 0;
  color: #fff;
  text-shadow: 0 0 26px color-mix(in srgb, var(--bw, #ffd166) 60%, transparent);
}
.bigwin-sub { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.bigwin-out { animation: fade-out .5s ease forwards; }

@keyframes bigwin-in {
  0% { opacity: 0; transform: scale(.7) rotate(-2deg); }
  60% { transform: scale(1.04) rotate(.4deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* --- bike art -------------------------------------------------------------- */

.bike-bob { animation: bob 3.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-.5deg); }
}

.art-wheel { animation: spin 2.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.art-pulse { animation: pulse 1.8s ease-in-out infinite; transform-origin: center; }
@keyframes pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

.art-core { animation: core 1.1s ease-in-out infinite; transform-origin: center; }
@keyframes core {
  0%, 100% { opacity: .75; filter: drop-shadow(0 0 4px #fff); }
  50% { opacity: 1; filter: drop-shadow(0 0 16px #ff8fa3); }
}

.art-charge { animation: charge 2.6s ease-in-out infinite; }
@keyframes charge {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.art-crank { animation: crank 1.4s linear infinite; transform-origin: 170px 152px; }
@keyframes crank { to { transform: rotate(360deg); } }

.art-secret { animation: secret-spin 9s linear infinite; transform-origin: 170px 120px; }
@keyframes secret-spin { to { transform: rotate(360deg); } }

/* click feedback on the showroom bike */
.stage-art.kick .bike-bob { animation: kick .28s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes kick {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.04) rotate(-1.6deg) translateY(-6px); }
  100% { transform: scale(1) rotate(0); }
}

.pop { animation: pop .25s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.reveal { animation: reveal .34s cubic-bezier(.2, .9, .3, 1.4) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px) scale(.86); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bike-bob, .art-wheel, .art-pulse, .art-core, .art-charge, .art-crank, .art-secret { animation: none; }
}
