body {
  margin: 0;
  font-family: sans-serif;
  background: #f0f0f0;
}

#game {
  position: relative;
  width: 100%;
  height: 300px;
  background: #eee;
  overflow: hidden;
  border-bottom: 4px solid #aaa;
}

#player {
  position: absolute;
  bottom: 0;
  left: 50px;
  width: 50px;
  height: 50px;
  background: blue;
  transition: all 0.2s;
}

#player.jump {
  bottom: 150px;
}

#player.duck {
  height: 25px;
}

#obstacle {
  position: absolute;
  bottom: 0;
  right: -50px;
  width: 50px;
  height: 50px;
  background: red;
  animation: moveObstacle 2s linear infinite;
}

@keyframes moveObstacle {
  from {
    right: -50px;
  }
  to {
    right: 100%;
  }
}
