/* The gold badge (badge.js). Each page sets its size. It can be pressed and held, so it doesn't select,
   drag or open the image menu. */
.badge {
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: scale 120ms ease-out;
}
.badge img { pointer-events: none; }
/* Held down: pushed in until it's let go. badge.js springs it back from this scale. */
.badge.is-pressed { scale: 0.9; }

/* Shine: community-home's shine buttons' sweep (hub.css, HubCommentFeed.js), cut to the badge's shape. */
.badge-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url(/logo.png) center / contain no-repeat;
  mask: url(/logo.png) center / contain no-repeat;
}
.badge-shine::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-130%);
}
.badge.is-shining .badge-shine::after { animation: badge-shine 1.15s ease-in-out; }
@keyframes badge-shine { to { transform: translateX(280%); } }

@media (prefers-reduced-motion: reduce) {
  .badge { transition: none; }
  .badge-shine { display: none; }
}
