.bonus-pod.ready .bonus-pill {
  animation: bonus-pop 3.2s ease-out infinite;
}

.bonus-pod.ready .bonus-pill::before {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  bottom: -2px;
  width: 200%;
  background: linear-gradient(105deg, transparent 52%, rgba(255, 246, 214, 0.8) 72%,
    rgba(255, 255, 255, 0.95) 86%, rgba(255, 246, 214, 0.8) 96%);
  opacity: 0;
  pointer-events: none;
  animation: bonus-sweep 3.2s ease-in-out infinite;
}

.bonus-pod.ready .bonus-pill::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 34%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(270deg, transparent, #ffd45a 35%, #fff 70%, transparent);
  box-shadow: 0 0 4px #ffd45a;
  pointer-events: none;
  animation: bonus-rail 1.6s linear infinite;
}

.bonus-pod.ready::before,
.lobby-bonus:has(> .bonus-pod.ready)::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20'%3E%3Cpath d='M9 1 3 10h5l-3 9 7-11H7l3-7z' fill='%23ffd45a' stroke='%23ffb000' stroke-width='1.6' stroke-linejoin='round' opacity='.55'/%3E%3Cpath d='M9 1 3 10h5l-3 9 7-11H7l3-7z' fill='%23fffbe8'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
}

.bonus-pod.ready::before {
  left: -12px;
  bottom: 8px;
  rotate: -16deg;
  animation: bonus-crackle 2.3s steps(1, end) infinite;
}

.lobby-bonus:has(> .bonus-pod.ready)::after {
  left: 46px;
  top: 2px;
  width: 13px;
  height: 19px;
  rotate: 20deg;
  animation: bonus-crackle 2.9s steps(1, end) -1.2s infinite;
}

.bonus-wheel.ready .tile-ring::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 3px solid #fff6c4;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px #ffd45a, inset 0 0 8px #ffd45a;
  opacity: 0;
  pointer-events: none;
  animation: bonus-ring 3.2s ease-out -1.6s infinite;
}

.bonus-wheel.ready .tile-ring > .lobby-art {
  transform-origin: 50% 88%;
  animation: bonus-rock 3.2s ease-in-out -1.6s infinite;
}

.bonus-wheel.ready::before,
.bonus-wheel.ready::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  background: linear-gradient(#fff, var(--gold-light));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  pointer-events: none;
  animation: lobby-icon-spark 1.8s ease-in-out infinite;
}

.bonus-wheel.ready::before {
  left: 1px;
  top: -2px;
  animation-delay: -0.6s;
}

.bonus-wheel.ready::after {
  left: -3px;
  top: 22px;
  width: 7px;
  height: 7px;
  animation-delay: -1.2s;
}

.lobby:not(.lobby-motion-active) .bonus-pod.ready .bonus-pill,
.lobby:not(.lobby-motion-active) .bonus-wheel.ready .tile-ring > .lobby-art {
  animation: none;
}

.lobby:not(.lobby-motion-active) .bonus-pod.ready .bonus-pill::before,
.lobby:not(.lobby-motion-active) .bonus-pod.ready .bonus-pill::after,
.lobby:not(.lobby-motion-active) .bonus-pod.ready::before,
.lobby:not(.lobby-motion-active) .lobby-bonus:has(> .bonus-pod.ready)::after,
.lobby:not(.lobby-motion-active) .bonus-wheel.ready .tile-ring::before,
.lobby:not(.lobby-motion-active) .bonus-wheel.ready::before,
.lobby:not(.lobby-motion-active) .bonus-wheel.ready::after {
  visibility: hidden;
  animation: none;
}

@keyframes bonus-pop {
  0%, 62% { scale: 1; }
  70% { scale: 1.07; }
  78% { scale: 0.98; }
  86%, 100% { scale: 1; }
}

@keyframes bonus-sweep {
  0%, 56% { opacity: 0; transform: none; }
  60% { opacity: 1; transform: translateX(-6%); }
  80% { opacity: 1; transform: translateX(-62%); }
  81%, 100% { opacity: 0; transform: translateX(-62%); }
}

@keyframes bonus-rail {
  0% { opacity: 0; transform: none; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-300%); }
}

@keyframes bonus-crackle {
  0%, 100% { opacity: 0; }
  8% { opacity: 1; }
  12% { opacity: 0.2; }
  16% { opacity: 1; }
  24% { opacity: 0; }
}

@keyframes bonus-ring {
  0%, 60% { opacity: 0; scale: 0.75; }
  65% { opacity: 1; scale: 0.95; }
  86%, 100% { opacity: 0; scale: 1.25; }
}

@keyframes bonus-rock {
  0%, 60% { rotate: 0deg; scale: 1; }
  65% { rotate: -9deg; scale: 1.08; }
  71% { rotate: 7deg; }
  77% { rotate: -4deg; scale: 1.02; }
  83% { rotate: 2deg; }
  89%, 100% { rotate: 0deg; scale: 1; }
}

.lobby.enter .lobby-bonus .bonus-pod,
.lobby.enter .lobby-bonus .bonus-wheel {
  animation: lobby-tile-pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) 340ms backwards;
}

@media (prefers-reduced-motion: reduce) {
  .lobby.enter .lobby-bonus .bonus-pod,
  .lobby.enter .lobby-bonus .bonus-wheel {
    animation: none;
  }
  .bonus-pod.ready .bonus-pill {
    box-shadow: 0 0 0 1px #603c22, inset 0 -2px 3px #0006, 0 4px 8px #0009;
  }
  .bonus-pod.ready::after {
    content: none;
    animation: none;
  }
  .bonus-pod.ready .bonus-pill,
  .bonus-wheel.ready .tile-ring > .lobby-art {
    animation: none;
  }
  .bonus-pod.ready .bonus-pill::before,
  .bonus-pod.ready .bonus-pill::after,
  .bonus-pod.ready::before,
  .lobby-bonus:has(> .bonus-pod.ready)::after,
  .bonus-wheel.ready .tile-ring::before,
  .bonus-wheel.ready::before,
  .bonus-wheel.ready::after {
    content: none;
    animation: none;
  }
}

.inbox-sheet {
  --inbox-satellite-light: #fff6c4;
  --inbox-satellite-dark: #b8780a;
}
